✨ frontend add
This commit is contained in:
19
frontend/portal/src/hooks/useInputs.ts
Normal file
19
frontend/portal/src/hooks/useInputs.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import React, { useState } from 'react'
|
||||
|
||||
export default function useInputs(initial: ValueType) {
|
||||
const [value, setValue] = useState<ValueType>(initial)
|
||||
|
||||
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setValue(event.target.value)
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO
|
||||
* validation 추가필요
|
||||
*/
|
||||
|
||||
return {
|
||||
value,
|
||||
onChange: handleChange,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user