-
Notifications
You must be signed in to change notification settings - Fork 46
Compatible with webpack Hot Module Replacement? #27
Comments
Here's a clue: If I structure my code as follows: export const provideCounter = provideState({
initialState: () => ({ counter: 0 }),
effects: {
increment: () => state => ({ ...state, counter: state.counter + 1 })
}
});
export const CounterComponent = ({ state, effects }) => {
const increment = ev => {
ev.preventDefault();
effects.increment();
};
return (
<div>
<div>Count: { state.count }</div>
<div><a href="#" onClick={ increment }>Increment!</a></div>
</div>
);
};
export const Counter = provideCount( injectState( CounterComponent ) ); ...then changes to markup within the However, if I structure my code in the following style (merging the functional component into the export const provideCounter = provideState({
initialState: () => ({ counter: 0 }),
effects: {
increment: () => state => ({ ...state, counter: state.counter + 1 })
}
});
export const Counter = provideCount( injectState( ({ state, effects }) => {
const increment = ev => {
ev.preventDefault();
effects.increment();
};
return (
<div>
<div>Count: { state.count }</div>
<div><a href="#" onClick={ increment }>Increment!</a></div>
</div>
);
})); ...then changes do not render with hot-module-replacement. This may be a limitation independent of |
I'm trying to use fr(e)actal with Next.js and is breaking HMR too even if I use the pattern proposed by @zebulonj. I also getting the warning message: |
This one is about React@16.0.0. |
I know that @JustFly1984, but the error is coming from Freactal that's why I'm posting it here so it can be updated for a new version. |
Should be a separate issue (not related to hit module replacement).
|
@zebulonj, this is a limitation of the component detection in |
Have you used
freactal
withwebpack
hot module replacement and thereact-hot-loader
? Just built a small test project withfreactal
and am not seeing component updates via thewebpack-dev-server
when I update files. PerhapsshouldComponentUpdate
is preventing the re-render?I'm going to look more closely as I'm able, but wanted to put this question out there in case others have an answer.
The text was updated successfully, but these errors were encountered: