Skip to content

Development issue #7

@entrptaher

Description

@entrptaher

Using the package on development mode from the git repo does not work.

  • Works: yarn run dev. It does not throw any error on console.
  • Works: yarn run test. It does not throw any error on console.
    It means it's built properly, right?

But,

  • Works: import createPersistedState from 'use-persisted-state'.
  • Doesn't Work: import createPersistedState from './use-persisted-state'. It throws the following error,
Hooks can only be called inside the body of a function component. (https://fb.me/react-invalid-hook-call)
  1 | import createPersistedState from './use-persisted-state';
  2 | const useCounterState = createPersistedState('count');
  3 | 
> 4 | const useCounter = initialCount => {
    |                                   ^  5 |   const [count, setCount] = useCounterState(initialCount);
  6 | 
  7 |   return {

I found no contribution guide so maybe I did not do it the right way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions