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

Hot loading for Flow not working #31

Open
neosarchizo opened this issue Nov 19, 2019 · 5 comments
Open

Hot loading for Flow not working #31

neosarchizo opened this issue Nov 19, 2019 · 5 comments

Comments

@neosarchizo
Copy link

Hi. Because I prefer to use Flow so I forked this repo and migrated to Flow environment.
my repo

But the hot loading is not working.
I added webpack plugins for Flow. But I don't know why it doesn't work.

@NickSeagull
Copy link

For some reason, the uppermost component (App) has to be a class in order for the hot-reloading to work

@a7ul
Copy link
Collaborator

a7ul commented Nov 20, 2019

Yes, the root component has to be a class component at this time because it uses traditional hot reloading method at the moment. But soon we should be moving to the react's fast refresh ( a fancier version of hot reloading) that should solve this. For the time being, there is that limitation.

@a7ul
Copy link
Collaborator

a7ul commented Nov 20, 2019

@neosarchizo Hot reloading doesnt really depend on the type system you use. It makes use of react and webpack's native hot reload feature.

@neosarchizo
Copy link
Author

@master-atul Ah I see. But when I use hot loading in CRA project, the root component is function based and the hot loading is working well. Does your hot loading method differ from it?

@a7ul
Copy link
Collaborator

a7ul commented Nov 20, 2019

Yes, CRA uses React-hotloader i think which inturn uses react-dom. But since we cant use react-dom, we had to use the hot reloading component (specifically react-proxy) which was previously used with React native aswell (before fast refresh).

I had a quick look at your code, it should have worked since you only swapped out typescript. But I cant seem to be able to make it work either. Maybe i ll take a look again when I have more time.

But if we can't make it work, then we might have to wait till we can implement fast refresh instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants