1import PhoneInput from 'react-phone-number-input'
2import CustomPhoneNumber from '../components/prebuilt/PhoneNumber'
3...
4<PhoneInput
5 placeholder='Enter phone number'
6 value={phone}
7 onChange={setPhone}
8 inputComponent={CustomPhoneNumber}
9/>
10...
11
1import { forwardRef } from 'react'
2import TextField from '@material-ui/core/TextField'
3import { makeStyles } from '@material-ui/core/styles'
4
5const useStyles = makeStyles(theme => ({
6 input: {
7 backgroundColor: '#fff'
8 }
9}))
10
11const phoneInput = (props, ref) => {
12 const classes = useStyles()
13
14 return (
15
16 <TextField
17 {...props}
18 InputProps={{
19 className: classes.input
20 }}
21 inputRef={ref}
22 fullWidth
23 size='small'
24 label='Phone Number'
25 variant='outlined'
26 name='phone'
27 />
28 )
29}
30export default forwardRef(phoneInput)
31