is not a function

I am currently learning Easy Peasy state for React, and my first error I came across is that is not a function.

Here is the codesandbox link:


1 Like

using useStoreState instead seems to work, like this…

function Todos() {
  const todos = useStoreState(state => state.todos.items)
  return (
      {, idx) => (
        <h2 key={idx}>{todo}</h2>

remember to add useStoreState to your imports too :slightly_smiling_face:

1 Like

You can look at the API docs for more info, useStoreState and useStore. They advise not to use useStore unless you have to. As far as I can tell it would look like this with useStore (well it seems to work anyway).


1 Like

Thank You Very Much! It worked!

1 Like