Skip to content

Commit

Permalink
refactor: move context hook to top of AutoField
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed Jan 10, 2025
1 parent 715710a commit cfd21d8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/core/components/AutoField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ function AutoFieldInternal<
}
) {
const { dispatch, overrides, selectedItem } = useAppContext();
const nestedFieldContext = useContext(NestedFieldContext);

const { id, Label = FieldLabelInternal } = props;

Expand Down Expand Up @@ -217,8 +218,6 @@ function AutoFieldInternal<

const Render = render[field.type] as (props: FieldProps) => ReactElement;

const nestedFieldContext = useContext(NestedFieldContext);

return (
<NestedFieldContext.Provider
value={{
Expand Down

0 comments on commit cfd21d8

Please sign in to comment.