Value

The MaskedTextBox enables you to control its value by setting the value property and handling the onChange event.

class App extends React.Component {
    state = { value: "5748-1570-0019-4334" };

    onChange = (event) => {
        const value = event.target.value;
        if (this.state.value !== value) {
            this.setState({ value: value });
        }
    };

    render() {
        return (
            <MaskedTextBox
                mask="0000-0000-0000-0000"
                value={this.state.value}
                onChange={this.onChange}
            />
        )
    }
}

ReactDOM.render(
    <App />,
    document.querySelector('my-app')
);
In this article
 /