3 ms·
As an aside, a workaround for that case is: const Comp = React.memo(NonMemoComp) as typeof NonMemoComp
by brundolf 5y ago
As an aside, a workaround for that case is:
const Comp = React.memo(NonMemoComp) as typeof NonMemoComp
- steve_adams_86 5y agoYeah, this has been the approach I’ve used but the purist in me really goes crazy not having it “just work”. Admittedly it’s pretty hard to have casting in cases like this come back to bite you. I suppose you could even write a lint to ensure memoized component casting is correct.