6 ms·
Sure, but that still doesn’t explain the difference in rerendering between writing down the JSX element as a child or passing it in via props.
by sfvisser 6y ago
Sure, but that still doesn’t explain the difference in rerendering between writing down the JSX element as a child or passing it in via props.
- knuthsat 6y agoThat JSX element is a function call, not a class that has a render method. If that <ExpensiveComponent /> was a `class ExpensiveComponent extends React.PureComponent { render() { ... } }` it would not be an issue because diff algorithm can step in. I think people are just recognizing that all of this stuff can be optimized away by a proper compiler and this will soon be done. Nothing stops anyone from figuring out the dependencies and doing proper rerenders without diffing algorithms running on every change.
- deleted 6y ago[deleted]