Skip to content

Demos

At path

<DataContext.Provider
data={{
foo: {
one: 1,
two: 2,
},
bar: 'Bar',
}}
>
<DataContext.At path="/foo">
<Field.Number path="/one" label="One" />
<Field.Number path="/two" label="Two" />
</DataContext.At>
</DataContext.Provider>

Iterate path

Object 1
Object 2
<DataContext.Provider
data={{
list: [
{
title: 'Object 1',
},
{
title: 'Object 2',
},
],
bar: 'Bar',
}}
onChange={(data) => console.log('onChange', data)}
onPathChange={(path, value) => console.log('onPathChange', path, value)}
>
<DataContext.At path="/list" iterate>
<Value.String path="/title" label="Title" />
<Field.String path="/title" label="Title" />
</DataContext.At>
</DataContext.Provider>