Skip to content

Commit

Permalink
chore: improve setTarget tn
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrader committed May 9, 2023
1 parent ea62aeb commit 682646a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/hooks/useFundingFormState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,10 @@ export const useFundingFormState = ({ rewards }: UseFundStateProps) => {

const [state, _setState] = useState<IFundForm>(initialState)

const setTarget = useCallback(
(event: any) => {
const { name, value } = event.target
const newState = { ...state, [name]: value }
_setState(newState)
},
[state],
)
const setTarget = useCallback((event: any) => {
const { name, value } = event.target
_setState((current) => ({ ...current, [name]: value }))
}, [])

const setState = useCallback((name: string, value: any) => {
_setState((current) => ({ ...current, [name]: value }))
Expand Down

0 comments on commit 682646a

Please sign in to comment.