Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
postalrat
5y ago
0 comments
Save
Share
You could also do {iWantToRunThis && <ComponentUsesEffect...
0 comments
1 comments · 1 top-level
top
newest
oldest
anonytrary
5y ago
I'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".
j
/
k
navigate · click thread line to collapse