-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.tsx
31 lines (29 loc) · 1.07 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import * as React from "react";
import * as ReactDOM from 'react-dom/client';
import {PhoneInput} from "../src";
import {TestList} from "./test-list";
const App: React.FC<{}> = () => {
const [input, setInput] = React.useState<HTMLInputElement | null>(null);
return <div className="row">
<form className="col-md-8" action="#" method="get">
<h4 className="mb-3">Awesome Ukranian Phone Input</h4>
<div className="form-group">
<label htmlFor="phone-input"/>
<PhoneInput
className="form-control"
id="phone-input"
name="phone"
autoComplete="on"
autoFocus
ref={(i: HTMLInputElement) => setInput(i)}
/>
</div>
<button type="submit" className="btn btn-outline-secondary">
Submit
</button>
</form>
<TestList input={input}/>
</div>
}
const root = ReactDOM.createRoot(document.querySelector('#app') as any);
root.render(<App />);