4 ms·
couldn't you just write the same function to handle the prop in both componentDidMount and componentDidUpdate ?
by sktguha 6y ago
couldn't you just write the same function to handle the prop in both componentDidMount and componentDidUpdate ?
- ng12 6y agoSure, but you still have to know to do that and to do it correctly by checking whether the relevant values have changed in componentDidUpdate.