Skip to content

Commit 929eb2c

Browse files
committed
fix: react imports
1 parent 5a47e65 commit 929eb2c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/react-netlify-forms/src/netlify-form.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useReducer, useRef, useCallback } from 'react'
12
import { encodeFormData } from './utils'
23
import NetlifyFormReducer from './netlify-form-reducer'
34
import { NetlifyFormProvider } from './netlify-form-context'
@@ -25,9 +26,9 @@ export const useNetlifyForm = ({
2526
recaptchaEnabled: enableRecaptcha,
2627
recaptchaInvisible: false
2728
}
28-
const [state, dispatch] = React.useReducer(NetlifyFormReducer, initialState)
29-
const formRef = React.useRef(null)
30-
const recaptchaRef = React.useRef(null)
29+
const [state, dispatch] = useReducer(NetlifyFormReducer, initialState)
30+
const formRef = useRef(null)
31+
const recaptchaRef = useRef(null)
3132

3233
const handleChange = ({ target: { name, value, files } }) => {
3334
dispatch({
@@ -84,10 +85,10 @@ export const useNetlifyForm = ({
8485
dispatch({ type: 'SET_SUCCESS' })
8586
return onSuccess(response, context)
8687
}
87-
const setHoneypotName = React.useCallback((ref) => {
88+
const setHoneypotName = useCallback((ref) => {
8889
return dispatch({ type: 'SET_HONEYPOT_NAME', payload: ref })
8990
}, [])
90-
const enableRecaptchaHandler = React.useCallback((enable) => {
91+
const enableRecaptchaHandler = useCallback((enable) => {
9192
return dispatch({ type: 'ENABLE_RECAPTCHA', payload: enable })
9293
}, [])
9394

0 commit comments

Comments
 (0)