Skip to content

Commit

Permalink
feat(concertoForm): allow updating form via json prop
Browse files Browse the repository at this point in the history
Signed-off-by: Diana Lease <[email protected]>
  • Loading branch information
DianaLease committed Oct 2, 2020
1 parent 5b3f055 commit 3582803
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/ui-concerto/src/lib/components/concertoForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ const ConcertoForm = (props) => {
const [modelManager, setModelManager] = useState(null);
const { onValueChange, options, models } = props;

useEffect(() => {
setValue(props.json);
}, [props.json]);

const onFieldValueChange = useCallback((e, key) => {
const fieldValue = e.type === 'checkbox' ? e.checked : e.value;
const valueClone = set({ ...value }, key, fieldValue);
Expand Down

0 comments on commit 3582803

Please sign in to comment.