You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React standard library—must-have toolbox for any React project.
7
+
React standard library—must-have toolbox for any React project.
8
8
9
-
-*Isomorphic* - all components work in browser and on server (and some in `react-native`).
10
-
- See [__demos__](https://streamich.github.io/libreact/demos/), [__docs__](https://streamich.github.io/libreact/en/), and [__package__](https://www.npmjs.com/package/libreact/).
- Most components implement [](https://github.com/streamich/react-universal-interface)
12
+
-*Isomorphic* - most components work in browser and on server (and some in `react-native`).
11
13
12
14
13
15
## Installation
@@ -19,10 +21,12 @@ npm i <a href="https://www.npmjs.com/package/libreact">libreact</a> --save
19
21
20
22
## Usage
21
23
22
-
Import each utility individually to decrease your bundle size
24
+
Library is modular—you can import each component by its name.
23
25
24
26
```js
25
27
import {mock} from'libreact/lib/mock';
28
+
// or
29
+
import {mock} from'libreact/modules/mock';
26
30
27
31
constMyComponent=mock();
28
32
```
@@ -75,7 +79,7 @@ const MyComponent = mock();
75
79
-[`<Provider>`](./docs/en/Provider.md#provider), [`<Consumer>`](./docs/en/Provider.md#consumer), [`withContext()`](./docs/en/Provider.md#withcontext-hoc), and [`@withContext`](./docs/en/Provider.md#withcontext-decorator)
76
80
-[`<Theme>`](./docs/en/theme.md#theme), [`<Themed>`](./docs/en/theme.md#themed), [`withTheme()`](./docs/en/theme.md#withtheme-hoc), and [`@withTheme`](./docs/en/theme.md#withtheme-decorator)
77
81
-[`<CssVarsProvider>`](./docs/en/cssvars.md), [`<CssVars>`](./docs/en/cssvars.md#cssvars), [`withCssVars()`](./docs/en/cssvars.md#withcssvars-hoc), and [`@withCssVars`](./docs/en/cssvars.md#withcssvars-decorator)
78
-
-[Router](./docs/en/routing.md)
82
+
-[__Routing__](./docs/en/routing.md): [`createRouter()`](./docs/en/routing.md#createrouter), [`<Router>`](./docs/en/routing.md#router), [`<Route>`](./docs/en/routing.md#route), [`<Switch>`](./docs/en/routing.md#switch), [`<Match>`](./docs/en/routing.md#match), [`<Link>`](./docs/en/routing.md#link), and [`go()`](./docs/en/routing.md#go)
79
83
-[`<Translations>`](./docs/en/translate.md#translations), [`<Translate>`](./docs/en/translate.md#translate-or-t), [`<T>`](./docs/en/translate.md#translate-or-t), [`withT()`](./docs/en/translate.md#witht-hoc), and [`@withT`](./docs/en/translate.md#witht-decorator)
80
84
-[UI](./docs/en/UI.md)
81
85
-[`<Portal>`](./docs/en/Portal.md), [`<Overlay>`](./docs/en/Overlay.md), and [`<Modal>`](./docs/en/Modal.md)
-[`<BrowserOnly>`](./docs/en/BrowserOnly.md), [`<ServerOnly>`](./docs/en/ServerOnly.md), and [`<ElectronOnly>`](./docs/en/ElectronOnly.md)
106
109
-[`<ErrorBoundary>`](./docs/en/ErrorBoundary.md) and [`withErrorBoundary()`](./docs/en/ErrorBoundary.md#witherrorboundary-hoc)
@@ -109,6 +112,7 @@ const MyComponent = mock();
109
112
-[`createRef()`](./docs/en/next/createRef.md), [`createState()`](./docs/en/next/createState.md), and [`createLifecycleEvents()`](./docs/en/next/createLifecycleEvents.md)
Uses [`Navigator.getBattery()`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getBattery) API to track battery level, charging status and time it takes to charge/discharge a battery.
0 commit comments