acdlite / recompose

A React utility belt for function components and higher-order components.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

renderNothing should export Nothing

cdiscount-dcohen opened this issue · comments

It could be interesting to know when renderNothing has been used and to search the Nothing component in the react tree. Access to this class ref could help a lot.

A simple export on the renderNothing module let dev know what happened :)

commented

Nothing is an internal implementation detail which is the reason why we do not export it. Can you explain why you would want to use it?

Since recompose is not a ui library but a set of utils to make hoc easier, I think developers should always have the possibility to get classes they're using in their code.
In my case, we use jest with a selector to set the depth of rendering we want, it stops when it finds a component matching the given class. So when using branch with renderNothing, we have to know the class ref used...

commented

We are trying our best to avoid increasing the API surface. For the test part, you can mock recompose and replace it with your implementation.

Understood, I close the issue and PR.
Thanks