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

Loadable Components? #48

Closed
justin808 opened this issue Mar 18, 2020 · 6 comments
Closed

Loadable Components? #48

justin808 opened this issue Mar 18, 2020 · 6 comments

Comments

@justin808
Copy link

justin808 commented Mar 18, 2020

Has anybody tried this plugin with loadable-components?

I'm guessing that there will be a similar issue:

@pmmmwh
Copy link
Owner

pmmmwh commented Mar 19, 2020

Loadable was never on my radar, but fast refresh works quite differently from RHL. Nonetheless, as Anton has stated in the linked issue, class-based components will lose state upon update (this is a known constraint for FR).

I am leaning towards that it will work, but I currently don't have much time to test this out since I don't use loadable myself.

@avetisk
Copy link

avetisk commented Mar 31, 2020

I'm using both together and haven't had any issues so far.

@pmmmwh
Copy link
Owner

pmmmwh commented Jun 11, 2020

I have verified that it works with loadable, and will persist state given that it is wrapping a function component.

@pmmmwh pmmmwh closed this as completed Jun 11, 2020
@justin808
Copy link
Author

@pmmmwh @avetisk did you try this plugin with loadable-components and SSR?

React.lazy is probably preferable to loadable-components if no SSR is needed.

@pmmmwh
Copy link
Owner

pmmmwh commented Jul 3, 2020

@pmmmwh @avetisk did you try this plugin with loadable-components and SSR?

No, but it works for CSR - so in theory it should work for SSR too. If it doesn't work, most likely it is a Webpack configuration problem rather than the plugin's problem.

@adbutterfield
Copy link

Not sure if anyone would be interested, but I have an example with SSR and loadable-components/typescript/styled-components: https://github.com/adbutterfield/fast-refresh-express

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

4 participants