useStore

A hook granting your components access to the store instance.

This should only be used for advanced or exceptional cases, for e.g. when you would like to dynamically extend the store deep within your component tree.

const store = useStore();

Example

import { useStore } from 'easy-peasy';

const AddTodo = () => {
  const store = useStore();
  return (
    <div>
      {store.getState().sayHello}
    </div>
  );
};