Search results

Disabled the DatePicker Component in React DatePicker component

11 Jan 2022 / 1 minute to read

To disable the DatePicker, use its enable property.

The following example demonstrates the DatePicker in a disabled state.

Copied to clipboard
// import the datepickercomponent
import { DatePickerComponent } from '@syncfusion/ej2-react-calendars';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

export default class App extends React.Component<{}, {}> {

    private enable:boolean = false;

    public render() {
        return (
            // specifies the tag for render the DatePicker component
            <DatePickerComponent enabled={this.enable} placeholder="Enter date"/>

ReactDOM.render(<App />, document.getElementById('element'));