Skip to content

Commit

Permalink
docs: use config prop (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds authored Aug 6, 2023
1 parent c0902b0 commit e3c01d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/complex-structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ function Example() {
{todos.map((todo) => (
<li key={todo.key}>
{/* Pass each item config to TodoFieldset */}
<TodoFieldset {...todo} />
<TodoFieldset config={todo} />
</li>
))}
</ul>
</form>
);
}

function TodoFieldset(config: FieldConfig<Todo>) {
function TodoFieldset({ config }: { config: FieldConfig<Todo> }) {
const ref = useRef<HTMLFieldsetElement>(null);
// Both useFieldset / useFieldList accept form or fieldset ref
const { title, notes } = useFieldset(ref, config);
Expand Down

0 comments on commit e3c01d6

Please sign in to comment.