import { useContext , useMemo } from 'react' ; import { ArrayInputContext , ArrayInputContextValue } from './ArrayInputContext' ; see { ArrayInput } see https export const useArrayInput = ( props ? ) : ArrayInputContextValue => { const context = useContext ( ArrayInputContext ) ; const memo = useMemo ( ( ) => ( { fields : props ?. fields , meta : props ?. meta , } ) , [ props ] ) ; if ( props ?. fields && props ?. meta ) { return memo ; } return context ; } ;