2 ms·
Been bitten by this in React using ES6 where we would sub-class components and override render to provide another layout (or whatever; change behavior). The ri
by theodorton 10y ago
Been bitten by this in React using ES6 where we would sub-class components and override render to provide another layout (or whatever; change behavior).
The right way to do it in React is to define a new Component and make the Component you'd like to depend on wrap around the returned JSX in render instead. Probably not a revolutionary paradigm, but it has made me better at reasoning about and structuring React components.