11import ClassMerger from '../tools/ClassNameGenerater'
2- import Proptypes from 'prop-types'
2+ // import Proptypes from 'prop-types'
33import { Form } from 'react-bootstrap'
44import styles from './MyPage.module.css'
55
@@ -11,8 +11,9 @@ function FormBox({
1111 max,
1212 pattern,
1313 setState,
14- inputHandler,
1514 value,
15+ isInvalid,
16+ invalidTest,
1617 disabled = false ,
1718} ) {
1819 return (
@@ -28,29 +29,30 @@ function FormBox({
2829 max = { max }
2930 pattern = { pattern }
3031 disabled = { disabled }
31- isInvalid = { true }
32+ isInvalid = { isInvalid }
3233 value = { value }
34+ formNoValidate
3335 onChange = { ( event ) => {
34- console . log ( event )
35- inputHandler ( event , setState )
36+ const input = event . target . value
37+ setState ( input )
3638 } }
3739 />
38- < Form . Control . Feedback type = "invalid" isInvalid = { true } >
39- 패턴에 맞지 않는 값입니다.
40+ < Form . Control . Feedback type = "invalid" >
41+ { invalidTest }
4042 </ Form . Control . Feedback >
4143 </ Form . Group >
4244 )
4345}
4446
45- FormBox . propTypes = {
46- id : Proptypes . string . isRequired ,
47- label : Proptypes . string . isRequired ,
48- type : Proptypes . string . isRequired ,
49- data : Proptypes . string . isRequired ,
50- min : Proptypes . string ,
51- max : Proptypes . string ,
52- pattern : Proptypes . string ,
53- disabled : Proptypes . bool ,
54- }
47+ // FormBox.propTypes = {
48+ // id: Proptypes.string.isRequired,
49+ // label: Proptypes.string.isRequired,
50+ // type: Proptypes.string.isRequired,
51+ // min : Proptypes.string,
52+ // max : Proptypes.string,
53+ // pattern : Proptypes.string,
54+ // setState : Proptypes.func ,
55+ // disabled: Proptypes.bool,
56+ // }
5557
5658export default FormBox
0 commit comments