Closed zenato closed 8 years ago
I wonder what's causing the problem, because this setup works fine for me. Did you run the app with npm run dev
? What do you see in the terminal, does it say webpack building...
, webpack built ...
but nothing happens in the browser?
I did run the app with npm run dev
.
modified shared/component/index.jsx
.
<h1>Todos</h1> to <h1>Todos-test</h1>
Chrome browser developer console:
[HMR] Updated modules:
[HMR] - ./shared/components/index.jsx
[HMR] App is up to date.
But nothing happens in the browser.
modified shared/component/Home.jsx
.
<div id="todo-list"> to <div id="todo-list"> test-text
This case works fine. (Re-render component with test-text comment)
Chrome browser developer console:
[HMR] Updated modules:
[HMR] - ./shared/components/Home.jsx
[HMR] App is up to date.
What is different two cases.?
@zenato, does it help if you comment out this code from index.jsx
and run the app in dev mode again:
componentDidMount = () => {
this.props.history.pushState(null, '/home');
}
?
@Dattaya, Thank you. Can't React HMR re-render parent component? Only current state component?
I don't know what exactly is going on there but in this situation pushState
doesn't make much sense anyway, it's better to make the Home
component an IndexRoute
, see this PR #25
@Dattaya,Thank you for your quick reply ^__^
I modified React component(ex. shared/Home.jsx). But, don't re-render component.
Maybe, Example has react hot module replacement setting problem. Help, please.