million: Not able to use UseState inside the block

What version of million are you using?


Are you using an SSR adapter? If so, which one?


What package manager are you using?


What operating system are you using?


What browser are you using?


Describe the Bug

While using block component

const Block=block(MyComp)

I am getting error “Invalid hook call. Hooks can only be called inside of the body of a function component”

I am using useState hooks inside the component.

What’s the expected result?

The block should work without the above issue

Link to Minimal Reproducible Example



  • I am willing to submit a pull request for this issue.

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

Agreed, @kdRanaa can we have a minimal reproduction that you’re facing?