Skip to content

Commit

Permalink
docs: use config prop
Browse files Browse the repository at this point in the history
This is just a suggestion. I find calling props anything other than "props" is unnecessarily confusing to folks.
  • Loading branch information
kentcdodds authored Jul 17, 2023
1 parent 6d6b522 commit 7e0f8cb
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 7e0f8cb

Please sign in to comment.