Simple custom hook for React to get the type of the nested child (github.com) 1 points by ozanyurtsever 4y ago ↗ HN
[–] ozanyurtsever 4y ago ↗ A component may want to make assumptions about its children to satisfy layout constraints.To satisfy this need in one of my projects, I have built a very simple custom hook and then decided to publish it publicly.Here is the thread that describes the problem further: https://github.com/microsoft/TypeScript/issues/13618I hope it can be helpful for someone. I also would like to hear if my approach has been already implemented by other repos, because I couldn't find any, back in time.Thanks.
1 comment
[ 3.4 ms ] story [ 6.8 ms ] threadTo satisfy this need in one of my projects, I have built a very simple custom hook and then decided to publish it publicly.
Here is the thread that describes the problem further: https://github.com/microsoft/TypeScript/issues/13618
I hope it can be helpful for someone. I also would like to hear if my approach has been already implemented by other repos, because I couldn't find any, back in time.
Thanks.