ControlledInput Class — react Architecture
Architecture documentation for the ControlledInput class in ChangeEventPlugin-test.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 53291e6d_a41f_3554_2112_2bd07692c55e["ControlledInput"] 6b9bdbac_9d1c_2454_d74c_e7775c11f840["ChangeEventPlugin-test.js"] 53291e6d_a41f_3554_2112_2bd07692c55e -->|defined in| 6b9bdbac_9d1c_2454_d74c_e7775c11f840 dc085d58_8996_556d_6db4_3129a975aba1["render()"] 53291e6d_a41f_3554_2112_2bd07692c55e -->|method| dc085d58_8996_556d_6db4_3129a975aba1
Relationship Graph
Source Code
packages/react-dom/src/events/plugins/__tests__/ChangeEventPlugin-test.js lines 613–629
class ControlledInput extends React.Component {
state = {value: 'initial'};
onChange = event => this.setState({value: event.target.value});
render() {
Scheduler.log(`render: ${this.state.value}`);
const controlledValue =
this.state.value === 'changed' ? 'changed [!]' : this.state.value;
return (
<input
ref={el => (input = el)}
type="text"
value={controlledValue}
onChange={this.onChange}
/>
);
}
}
Source
Frequently Asked Questions
What is the ControlledInput class?
ControlledInput is a class in the react codebase, defined in packages/react-dom/src/events/plugins/__tests__/ChangeEventPlugin-test.js.
Where is ControlledInput defined?
ControlledInput is defined in packages/react-dom/src/events/plugins/__tests__/ChangeEventPlugin-test.js at line 613.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free