This will allow easy conditional rendering and will integrate well with many CSS-in-JS technologies ! :)
Usage:
const SuperMenu = ({classes}) => (
<NavLink to={'/space'} functionAsChild>
{ active => (
<FancyButton className={active ? classes.rainbow : classes.gray}>
{ active ? "You're in space now! Whooaaa" : 'Go to space !' }
</FancyButton>
)}
</NavLink>
)
If there is a super fancy way to distinguish normal childs and functionsAsChilds, it would be better to use that instead of having a functionAsChild prop
But for the time being I hope this will help somebody !
This will allow easy conditional rendering and will integrate well with many CSS-in-JS technologies ! :)
Usage:
If there is a super fancy way to distinguish normal childs and functionsAsChilds, it would be better to use that instead of having a functionAsChild prop
But for the time being I hope this will help somebody !