2 ms·
You could also do {iWantToRunThis && <ComponentUsesEffect...
by postalrat 6y ago
You could also do {iWantToRunThis && <ComponentUsesEffect...
- anonytrary 6y agoI've seen a lot of people using this strategy -- creating a null component that just runs an effect. It works and is totally valid, but IMO increases the API surface area unnecessarily. It should work without resorting to this "hack".