Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next.js example with hooks #13773

Closed
virzak opened this issue Dec 3, 2018 · 5 comments
Closed

Next.js example with hooks #13773

virzak opened this issue Dec 3, 2018 · 5 comments
Assignees
Labels
docs Improvements or additions to the documentation

Comments

@virzak
Copy link
Contributor

virzak commented Dec 3, 2018

I'm getting an error when converting the next.js app to use makeStyles

Unhandled Rejection (Invariant Violation): Hooks can only be called inside the body of a function component.

  47 | 
  48 | // Get the context of the page to collected side effects.
  49 | const pageContext = getPageContext();
> 50 | const page = renderPage((Page) => (props) => {
  51 |   //const pageWithContext = page as Component<InjectPageContext>;
  52 |   return (
  53 |     <JssProvider registry={pageContext.sheetsRegistry} generateClassName={pageContext.generateClassName}>

Would it be possible to update the example or provide tips on how to convert?

@revolunet
Copy link

Hi, did you solve it ?

@virzak
Copy link
Contributor Author

virzak commented Dec 9, 2018

@revolunet I did not.

@eps1lon
Copy link
Member

eps1lon commented Dec 11, 2018

Are you using both react@next and react-dom@next?

@virzak
Copy link
Contributor Author

virzak commented Dec 11, 2018

Yes

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Dec 16, 2018
@oliviertassinari oliviertassinari self-assigned this Dec 16, 2018
@oliviertassinari
Copy link
Member

#13920

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

No branches or pull requests

4 participants