Skip to content

Commit 3ddcd2a

Browse files
committed
fixture
1 parent 6b4d976 commit 3ddcd2a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

fixtures/ssr/src/components/Page.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,17 @@ const autofocusedInputs = [
1111
];
1212

1313
export default class Page extends Component {
14-
state = {active: false};
14+
state = {active: false, value: ''};
1515
handleClick = e => {
1616
this.setState({active: true});
1717
};
18+
handleChange = e => {
19+
this.setState({value: e.target.value});
20+
};
21+
componentDidMount() {
22+
// Rerender on mount
23+
this.setState({mounted: true});
24+
}
1825
render() {
1926
const link = (
2027
<a className="link" onClick={this.handleClick}>
@@ -30,6 +37,10 @@ export default class Page extends Component {
3037
<p>Autofocus on page load: {autofocusedInputs}</p>
3138
<p>{!this.state.active ? link : 'Thanks!'}</p>
3239
{this.state.active && <p>Autofocus on update: {autofocusedInputs}</p>}
40+
<p>
41+
Controlled input:{' '}
42+
<input value={this.state.value} onChange={this.handleChange} />
43+
</p>
3344
</Suspend>
3445
</div>
3546
);

0 commit comments

Comments
 (0)