import './demo13.css'; import Button from '../../button'; import Field from '..'; import Input from '../../input'; import React from 'react'; import ReactDOM from 'react-dom'; class App extends React.Component { field: Field; constructor(props) { super(props); this.field = new Field(this, { parseName: true, values: { objWithDefaults: { a: 1, b: 2, }, }, }); } onGetValue() { console.log(this.field.getValues()); } onSetValue() { this.field.setValues({ obj: { b: 'b', c: 'c', }, arr: [ 'first', 'second' ], objWithDefaults: { a: 100, b: 200, }, }); } render() { const { init, reset, resetToDefault } = this.field; return (
{JSON.stringify(this.field.getValues(), null, 2)}