-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues and my issue is unique
- My issue appears in the command-line and not only in the text editor
Description Overview
this is a follow-up to #3707. the release of React v19 stable means that support for the new onBeforeToggle event prop, as well as the camelCased popover attributes popoverTarget and popoverTargetAction, has now landed in the current latest stable release (they were added in this PR).
here’s an example trigger + popover:
<>
<button popoverTarget="foo" popoverTargetAction="show">
Open Popover
</button>
<div
id="foo"
onBeforeToggle={event => console.log('beforeToggle from', event.oldState, 'to', event.newState)}
popover="auto"
>
<h1>Popover Foo</h1>
</div>
</>example errors:
68:13 error Unknown property 'onBeforeToggle' found react/no-unknown-property
78:17 error Unknown property 'popoverTarget' found, use 'popovertarget' instead react/no-unknown-property
79:17 error Unknown property 'popoverTargetAction' found, use 'popovertargetaction' instead react/no-unknown-property
these occur when running my lint npm run script: "lint": "eslint .",
Expected Behavior
i expect the new event, onBeforeToggle and the camelCased attributes to not be considered “unknown” properties
eslint-plugin-react version
v7.37.2
eslint version
v9.16.0
node version
v22.7.0