-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Is it possible to get hot-reload with typescript working? #6503
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
Comments
Why not? It seems like it should be possible: https://github.com/gaearon/react-hot-loader#typescript I was able to get it working by adding react-app-rewire-hot-loader but that starts to complicate things. |
@kumar303 does it work at all? What are complications? |
Yes, after following the instructions in
Well, it involves replacing all |
It seems it works with that setup, closing this issue. |
Could you please re-open the issue so that it gets fixed properly in create-react-app? |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Could someone from the team please consider this feature? I think it's really important. As an example: sometimes I need to perform a few clicks to set up my UI in a state for development. Without proper hot reloading, the whole page gets reloaded as I edit files and I lose my state. |
We would be happy to consider this feature but without someone from the community doing the work and submitting a PR it's probably not going to happen. We have very limited resources and can barely keep up with all the issues and PRs that come in every day. |
OK, I can look into making a patch for it. I just wanted to make sure there wasn't already some reason that hot reloading is disabled. |
I think the reason is just that it's tricky to get it working properly. |
All that react-app-rewire-hot-loader does is add |
I published a version of
|
Would definitely appreciate this working out of the box 👍 |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
It is still not working. I've included TS in my create-react-app as described here and hot reload stopped working for What is the fix? Where are docs about fix? |
@wzup here's what I finally got working:
|
Don't forget to add those dependencies :
|
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
A team member has agreed in #6503 (comment) that this is an important feature. |
I don't think we'll support react-hot-loader out of the box so I'm closing this issue. You can also use one of the workarounds provided above. |
@bugzpodder why wouldn't create react app support hot reloading a typescript application out of the box? Reloading hooks (#5958) is only a small piece so I don't see how tracking that PR would be helpful. |
We also don't support react-hot-loader for js applications, it's not just typescript. It will be supported when #5958 lands. Webpack HMR is already supported out of the box |
@bugzpodder any reason for not supporting react-hot-loader out of the box? |
Dan has a list of things he want to accomplish and I can't find it right now. You can see https://gist.github.com/gaearon/a4d9fb3e6ea487a9296a8d2d9a6e3bf2 for some of his ideas. |
Oh, my bad. I thought this issue was about hot reloading in general. I am using Webpack HMR in a create react app (with TypeScript) and hot reloading still doesn't work for some cases, even with all the suggested redux/router setup. I will try to remember what those cases are. For some reason I thought all my trouble with this was related to TypeScript but now I can't remember why. |
No description provided.
The text was updated successfully, but these errors were encountered: