diff --git a/lib/rules/jsx-handler-names.js b/lib/rules/jsx-handler-names.js index 769a74f35c..2d2861ed7b 100644 --- a/lib/rules/jsx-handler-names.js +++ b/lib/rules/jsx-handler-names.js @@ -27,6 +27,10 @@ module.exports = function(context) { var propKey = typeof node.name === 'object' ? node.name.name : node.name; var propValue = context.getSource(node.value.expression).replace(/^this\./, ''); + if (propKey === 'ref') { + return; + } + var propIsEventHandler = PROP_EVENT_HANDLER_REGEX.test(propKey); var propFnIsNamedCorrectly = EVENT_HANDLER_REGEX.test(propValue); diff --git a/tests/lib/rules/jsx-handler-names.js b/tests/lib/rules/jsx-handler-names.js index 7a0eeeeaf6..5b1094d6ef 100644 --- a/tests/lib/rules/jsx-handler-names.js +++ b/tests/lib/rules/jsx-handler-names.js @@ -64,6 +64,11 @@ ruleTester.run('jsx-handler-names', rule, { '' ].join('\n'), parserOptions: parserOptions + }, { + code: [ + '' + ].join('\n'), + parserOptions: parserOptions }], invalid: [{