react-transform-boilerplate-ts icon indicating copy to clipboard operation
react-transform-boilerplate-ts copied to clipboard

Certain changes to .tsx aren't picked up

Open vladimir-rovensky opened this issue 8 years ago • 2 comments

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?

vladimir-rovensky avatar Jan 20 '16 19:01 vladimir-rovensky

(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

jbrantly avatar Jan 25 '16 14:01 jbrantly

Thanks very much for the input, @jbrantly. I think #2 is also related to this.

wmaurer avatar Jan 25 '16 14:01 wmaurer