41
GitHub - streamich/libreact: Collection of useful React.js components
source link: https://github.com/streamich/libreact
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
libreact
React standard library — must-have toolbox for any React project.
- Isomorphic - all components work in browser and on server (and some in
react-native
). - See demos, docs, and package.
Installation
npm i libreact --save
Usage
Import each utility individually to decrease your bundle size
import {mock} from 'libreact/lib/mock'; const MyComponent = mock();
Contents
- Introduction
- Dummies
mock()
andloadable()
— examplelazy()
anddelayed()
- Inversion
<State>
andwithState()
<Toggle>
,withToggle()
, and@withToggle
— example<Flipflop>
,withFlipflop()
, and@withFlipflop
<Value>
,withValue()
, and@withValue
<Counter>
,withCounter()
and@withCounter
<List>
,withList()
, and@withList
<Map>
,withMap()
, and@withMap
<ShouldUpdate>
,shouldUpdate()
, andpure()
<Lifecycles>
invert()
and<Inverted>
- Sensors
<ActiveSensor>
,withActive()
, and@withActive
<BatterySensor>
,withBattery()
, and@withBattery
<ExitSensor>
— example<FocusSensor>
,withFocus()
, and@withFocus
<GeoLocationSensor>
,withGeoLocation()
, and@withGeoLocation
<HoverSensor>
,withHover()
, and@withHover
— example<IdleSensor>
,withIdle()
, and@withIdle
<MediaDeviceSensor>
,withMediaDevices()
, and@withMediaDevices
<MediaSensor>
,withMedia()
, and@withMedia
<MotionSensor>
,withMotion()
, and@withMotion
<MouseSensor>
,withMouse()
, and@withMouse
— example<NetworkSensor>
,withNetwork()
, and@withNetwork
<LightSensor>
,withLight()
, and@withLight
<LocationSensor>
,withLocation()
, and@withLocation
<OrientationSensor>
,withOrientation()
, and@withOrientation
<ScratchSensor>
,withScratch()
, and@withScratch
<ScrollSensor>
<SizeSensor>
,withSize()
, and@withSize
— example<ViewportSensor>
,withViewport()
, and@withViewport
<WindowScrollSensor>
,withWindowScroll()
, and@withWindowScroll
<WindowSizeSensor>
,withWindowSize()
, and@withWindowSize
- Context
- UI
- Animation
- Side Effects
- Boundaries
<BrowserOnly>
,<ServerOnly>
, and<ElectronOnly>
<ErrorBoundary>
andwithErrorBoundary()
<CacheBoundary>
- NEXT
- Other
License
Unlicense — public domain.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK