Skip to content

Commit 82f1aeb

Browse files
authored
Update README.md
1 parent 6a1b600 commit 82f1aeb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ Once we've built our definition, we'll feed it to the `FormEngine`, which return
115115
const instance = new FormEngine(definition);
116116
```
117117

118+
To rehydrate a form instance from a previous state, we'd pass in our model as the second argument.
119+
120+
```javascript
121+
122+
const model = {username: 'mikechabot', city: 'Boston', state: 'MA'};
123+
const instance = new FormEngine(definition, model);
124+
```
125+
118126
Then, we just pass the instance to the `<Form />` component, and `react-json-form-engine` takes care of the rest:
119127

120128
```jsx

0 commit comments

Comments
 (0)