react-auto-subcomponent
create react components on-the-fly by simply accessing them!
usage
the api is generally as follows:
// Thing.jsximport auto from 'react-auto-subcomponent'PureComponent { return <div ='thing'>...thispropschildren</div> } Thing <div ='thing-auto'> propschildren </div> // now use it!// App.jsimport Thing from './Thing' { return <Thing> <Thing.X>I never specified a `.X` component!</Thing.X> <Thing.Y>But it component renders using the 2nd arg to auto!</Thing.Y> <Thing.Z>This is useful for creating layout variants using</Thing.Z> <Thing.Q>similarly named components</Thing.Q> </Thing> }