File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/ra-core/src/form Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -20,16 +20,16 @@ const Input: FunctionComponent<
2020const InputWithCustomOnChange : FunctionComponent <
2121 {
2222 children : ( props : ReturnType < typeof useInput > ) => ReactElement ;
23- } & InputProps & { getContextValue ?: ( value : string ) => void }
24- > = ( { children, getContextValue , ...props } ) => {
23+ } & InputProps & { setContextValue ?: ( value : string ) => void }
24+ > = ( { children, setContextValue , ...props } ) => {
2525 const { getValues } = useFormContext ( ) ;
2626
2727 return (
2828 < Input
2929 { ...props }
3030 onChange = { e => {
3131 props . onChange ( e ) ;
32- getContextValue ( getValues ( ) [ props . source ] ) ;
32+ setContextValue ( getValues ( ) [ props . source ] ) ;
3333 } }
3434 >
3535 { children }
@@ -131,7 +131,7 @@ describe('useInput', () => {
131131 const handleChange = e => {
132132 targetValue = e . target . value ;
133133 } ;
134- const getContextValue = value => {
134+ const setContextValue = value => {
135135 contextValue = value ;
136136 } ;
137137
@@ -142,7 +142,7 @@ describe('useInput', () => {
142142 source = "title"
143143 resource = "posts"
144144 onChange = { handleChange }
145- getContextValue = { getContextValue }
145+ setContextValue = { setContextValue }
146146 defaultValue = ""
147147 >
148148 { ( { id, field } ) => (
You can’t perform that action at this time.
0 commit comments