reactlite
Install
npm install --save reactlite
Usage
DEMO
https://codesandbox.io/s/7yqyq2q8x
Box
<Box ="red" ="24px"> 24px Red Div</Box>
Container
<Container ="red" ="green" ="blue"> media query auto change backgroundColor: Red/Green/Blue</Container>
Layer
import React Component from 'react'; import Layer Text from 'reactlite'; { let showLayer = thisprops; return showLayer && <Layer> <Text>Layer Content</Text> </Layer> ; }
全局 Layer
import React Component from 'react'; import Box Button Text Layer from 'reactlite'; { return <Layer.Placeholder />; } { thiselement = <Text>Layer Content</Text>; Layer; }; { Layer; }; { return <Box> <Button =>add</Button> <Button =>remove</Button> </Box> ; }
unmount self
import React Component from 'react'; import Layer from 'reactlite'; { return <Layer.Placeholder />; } { thisprops; }; { return <div> <button =>unmount self</button> </div> ; } { thiselement = <Modal />; Layer; }; { return <button =>add</button>; }
License
MIT © lomocc