Unless I am mistaken, it seems today that the rule react/no-danger has specific logic to only find usages on native elements. See the isDOMComponent check here:
|
if (jsxUtil.isDOMComponent(node.parent) && isDangerous(node.name.name)) { |
We think it could be useful to support non-native components as well, especially in cases like styled-components wrappers, or components that want to offer this prop to be forwarded internally to a native element.
This could be a new default behavior, or an opt-in behavior via a new rule option.
Unless I am mistaken, it seems today that the rule
react/no-dangerhas specific logic to only find usages on native elements. See theisDOMComponentcheck here:eslint-plugin-react/lib/rules/no-danger.js
Line 63 in 8c9ec8a
We think it could be useful to support non-native components as well, especially in cases like
styled-componentswrappers, or components that want to offer this prop to be forwarded internally to a native element.This could be a new default behavior, or an opt-in behavior via a new rule option.