@ea-lab/reactive-json 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,18 +7,22 @@ This lib lessens the need to write JS code for building frontend apps.
|
|
|
7
7
|
With *reactive-json*, build your apps and forms frontend, embed them into your websites,
|
|
8
8
|
and make them interactive with your backend.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
TODO: make and insert a descriptive image.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## How to use *reactive-json*
|
|
13
13
|
|
|
14
14
|
The library can be:
|
|
15
15
|
|
|
16
|
-
- included in your React project: use the provided `<ReactiveJsonRoot>` component
|
|
17
|
-
in your React app. This is the way to go if you want to use reactive-json plugins.
|
|
18
16
|
- used as a standalone lib: simply load the dist files in your web page
|
|
19
17
|
and it will work on the `<reactive-json>` HTML tags.
|
|
18
|
+
- included in your React project: use the provided `<ReactiveJsonRoot>` component
|
|
19
|
+
in your React app. This is the way to go if you want to use reactive-json plugins.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
If you retrieved the source code of *reactive-json*, a demo app is available for use.
|
|
22
|
+
|
|
23
|
+
```shell
|
|
24
|
+
npm run dev
|
|
25
|
+
```
|
|
22
26
|
|
|
23
27
|
## How to install *reactive-json*
|
|
24
28
|
|
|
@@ -45,12 +49,25 @@ First, install the lib:
|
|
|
45
49
|
npm install @ea-lab/reactive-json
|
|
46
50
|
```
|
|
47
51
|
|
|
48
|
-
And that's all!
|
|
49
|
-
in your React components.
|
|
52
|
+
And that's all!
|
|
50
53
|
|
|
51
54
|
You will have to use the `<ReactiveJsonRoot>` component, with the appropriate
|
|
52
55
|
options.
|
|
53
56
|
|
|
57
|
+
```js
|
|
58
|
+
import {ReactiveJsonRoot} from "@ea-lab/reactive-json";
|
|
59
|
+
|
|
60
|
+
//...
|
|
61
|
+
|
|
62
|
+
const YourComponent = () => {
|
|
63
|
+
return (
|
|
64
|
+
<div>
|
|
65
|
+
<ReactiveJsonRoot dataUrl={"/path/to/build.json"}/>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
```
|
|
70
|
+
|
|
54
71
|
## How to extend *reactive-json*
|
|
55
72
|
|
|
56
73
|
To add new components, you must be in library mode. Indeed, the
|