/
index.js
39 lines (34 loc) · 1.1 KB
/
index.js
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
32
33
34
35
36
37
38
import React from 'react';
import ReactDOM from 'react-dom';
import { setupViewContainer, setupFormInput } from 'no-tab';
const Input = setupFormInput(props => <input {...props}/>);
const BasicExampleView = setupViewContainer(
() => (
<div className="example-view">
<h3>Basic Example</h3>
<Input placeholder="formId a" formId="a"/>
<Input placeholder="formId b" formId="b"/>
<Input placeholder="formId c" formId="c"/>
<Input placeholder="formId d" formId="d"/>
</div>
)
);
const MultiInputFormExampleView = setupViewContainer(
() => (
<div className="example-view">
<h3>Matching FormId Example</h3>
<Input placeholder="formId a" formId="a"/>
<Input placeholder="formId a" formId="a"/>
<Input placeholder="formId b" formId="b"/>
<Input placeholder="formId b" formId="b"/>
</div>
)
);
ReactDOM.render(
<div>
<h1>NoTab Examples</h1>
<BasicExampleView/>
<MultiInputFormExampleView/>
</div>,
document.getElementById('example')
);