You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I enabled react/jsx-handler-names rule today for my codebase and everything went well, except one case with stateless component for modal. I put all handlers there in props and from docs it shouldn't consider warnings, but it does.
Next code,
importReact,{PropTypes}from"react";import{Button,Modal}from"react-bootstrap";constClearChangesModal=(props)=>{return(<ModalonHide={props.onClose}show><Modal.Body><p>Are You Sure to discard all changes?</p><pclassName="text-danger">This action is undone.</p></Modal.Body><Modal.Footer><ButtononClick={props.onClose}>Cancel</Button><ButtonbsStyle="danger"onClick={props.onClear}>
Discard
</Button></Modal.Footer></Modal>);};ClearChangesModal.propTypes={onClear: PropTypes.func.isRequired,onClose: PropTypes.func.isRequired};exportdefaultClearChangesModal;
gives me,
10:16 error Handler function for onHide prop key must be named handleHide react/jsx-handler-names
19:25 error Handler function for onClick prop key must be named handleClick react/jsx-handler-names
20:42 error Handler function for onClick prop key must be named handleClick react/jsx-handler-names
which is wrong, I suppose.
For now I disabled react/jsx-handler-names rule in the component, but hope you can fix it soon. Thanks!
The text was updated successfully, but these errors were encountered:
I enabled
react/jsx-handler-names
rule today for my codebase and everything went well, except one case with stateless component for modal. I put all handlers there in props and from docs it shouldn't consider warnings, but it does.Next code,
gives me,
which is wrong, I suppose.
For now I disabled
react/jsx-handler-names
rule in the component, but hope you can fix it soon. Thanks!The text was updated successfully, but these errors were encountered: