File tree Expand file tree Collapse file tree 1 file changed +24
-7
lines changed
Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ Let's briefly have a look at the most important files:
1414* ` src/App.js ` is the main React component and makes use of the JSON Forms Component
1515 in order to render a form.
1616
17- The [ data schema] ( https://github.com/edgarmueller /jsonforms-react-seed/blob/master/src/schema.json ) defines
17+ The [ data schema] ( https://github.com/eclipsesource /jsonforms-react-seed/blob/master/src/schema.json ) defines
1818the structure of a Task: it contains attributes such as title, description, due date and so on.
1919
20- The [ corresponding UI schema] ( https://github.com/edgarmueller /jsonforms-react-seed/blob/master/src/uischema.json )
20+ The [ corresponding UI schema] ( https://github.com/eclipsesource /jsonforms-react-seed/blob/master/src/uischema.json )
2121specifies controls for each property and puts them into a vertical layout that in turn contains two
2222horizontal layouts.
2323
@@ -30,15 +30,32 @@ Please refer to TODO for how to do this.
3030## Setting up the store
3131
3232``` js
33- import schema from ' ./schema.json' ;
34- import uischema from ' ./uischema.json' ;
33+ const store = createStore (
34+ jsonformsReducer (),
35+ {
36+ jsonforms: {
37+ common: {
38+ data,
39+ schema,
40+ uischema
41+ },
42+ renderers: JsonForms .renderers ,
43+ fields: JsonForms .fields
44+ },
45+ },
46+ applyMiddleware (thunk)
47+ );
3548
36- // TODO: update JSONForms to most recent version to support new signature
37- const store = initJsonFormsStore ({
49+ // initialize store
50+ store .dispatch ({
51+ type: Actions .INIT ,
3852 data,
39- schema,
53+ schema,
4054 uischema,
4155});
56+
57+ // trigger initial validation
58+ store .dispatch (Actions .validate ());
4259```
4360
4461We then use the ` Provider ` component provided by ` react-redux ` to provide the store to the
You can’t perform that action at this time.
0 commit comments