You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.
This can be reproduced in the react-app-minimal-hello-world example by upgrading react into version 16.8.0 and using hooks:
// @flowimportReact,{useState}from"react";import{Router,Route,browserHistory}from"react-router";import{createApp}from"@phenomic/preset-react-app/lib/client";// import { createApp, renderApp } from "@phenomic/preset-react-app/lib/client";constExample=()=>{const[test,setTest]=useState(false)return'Hello world'}exportdefaultcreateApp(()=>(<Routerhistory={browserHistory}><Routepath="/"component={Example}/></Router>));// uncommment to get hot loading// if (module.hot) {// module.hot.accept(() => renderApp(routes));// }
phenomic start works fine, so I was caught a bit off guard, but I guess phenomic does a bit of magic when building so it's not completely odd. Any idea on when hooks become usable?
Using latest version from next.
The text was updated successfully, but these errors were encountered:
Thanks for reporting.
This was due to SSR that were using 2 versions of the same react (one compiled in webpack bundle, one not...). I fixed it by adding react & react-dom as external deps for static rendering.
So Hooks should work with latest beta (10). Enjoy!
This can be reproduced in the
react-app-minimal-hello-world
example by upgradingreact
into version16.8.0
and using hooks:The error message redirects you here https://reactjs.org/warnings/invalid-hook-call-warning.html
phenomic start
works fine, so I was caught a bit off guard, but I guess phenomic does a bit of magic when building so it's not completely odd. Any idea on when hooks become usable?Using latest version from
next
.The text was updated successfully, but these errors were encountered: