react-nodegui-starter icon indicating copy to clipboard operation
react-nodegui-starter copied to clipboard

Hot loading for Flow not working

Open neosarchizo opened this issue 5 years ago • 5 comments

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.

neosarchizo avatar Nov 19 '19 03:11 neosarchizo

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

NickSeagull avatar Nov 20 '19 12:11 NickSeagull

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 avatar Nov 20 '19 12:11 a7ul

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

a7ul avatar Nov 20 '19 12:11 a7ul

@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?

neosarchizo avatar Nov 20 '19 12:11 neosarchizo

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.

a7ul avatar Nov 20 '19 12:11 a7ul