class App extends React.Component {
state = {
value: '',
}
onChange = ({ target: { value } }) => {
this.setState({ value });
}
render() {
const name = this.state.value.split(/\s+/);
return (
<div>
<input onChange={this.onChange} />
<p>Ф: {name[0]}</p>
<p>И: {name[1]}</p>
<p>О: {name[2]}</p>
{name[3] && <p>WTF??! {name.slice(3)}</p>}
</div>
);
}
}