Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unknown property 'onBeforeToggle' found (react/no-unknown-property) #3864

Closed
2 tasks done
acusti opened this issue Dec 10, 2024 · 0 comments · Fixed by #3865
Closed
2 tasks done

[Bug]: Unknown property 'onBeforeToggle' found (react/no-unknown-property) #3864

acusti opened this issue Dec 10, 2024 · 0 comments · Fixed by #3865
Labels

Comments

@acusti
Copy link
Contributor

acusti commented Dec 10, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 participant