UNPKG

react-codemod

Version:
19 lines (16 loc) 412 B
class SomeName extends React.Component { _onChange: Function; constructor(props: Object) { super(props); if (!this.props.something.somePreference) { this._onChange(SomeConstantsOptions.SOME_CONSTANT); } } /* Some comment */ _onChange = (value: String): void => { Dispatcher.handleViewAction({ type: SomeConstantsOptions.SOME_CONSTANT, payload: value, }); }; }