react-transform-boilerplate-ts
react-transform-boilerplate-ts copied to clipboard
Certain changes to .tsx aren't picked up
Here's an example (slightly modified Counter class from src):
export default class Counter extends React.Component<ICounterProps, ICounterState> {
...
label: string = 'Counter';
render() {
return (
<h1 style={{ color: this.props.color }}>
{this.label} ({this.props.increment}): {this.state.counter}
</h1>
);
}
}
If I declare a field on the class (label
) and render its value, changes to it aren't picked up at all. Try changing 'Counter' to another string, nothing happens, even though the log says that the class was patched.
Is this some limitation of HMR (I'm pretty new to all this) or a bug?
(I know I already answered your question on SO but I thought I'd answer here as well for the benefit of others)
This is a known limitation in react-proxy according to https://github.com/gaearon/react-proxy#known-limitations
- Does not replace ES7 instance properties
Thanks very much for the input, @jbrantly. I think #2 is also related to this.