3 ms·
The problem before was that your class component was not updating correctly and rendering stale & out of sync data. If it were updating correctly, it would have
by exogen 6y ago
The problem before was that your class component was not updating correctly and rendering stale & out of sync data. If it were updating correctly, it would have had the same infinite loop problems.
- ng12 6y agoExactly this. Class components let you cheat and easily write components that were broken if a prop was unexpectedly updated. Hooks will surface this immediately.