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

persists the event onClick #59

Open
rawnly opened this issue Aug 12, 2019 · 1 comment
Open

persists the event onClick #59

rawnly opened this issue Aug 12, 2019 · 1 comment

Comments

@rawnly
Copy link

rawnly commented Aug 12, 2019

If I try to catch the event on user click (to handle modifer keys such as CTRL, CMD, ALT) I receive this warning and the event properties are null.

Warning: This synthetic event is reused for performance reasons. If you're seeing this, you're accessing the property nativeEvent on a released/nullified synthetic event. This is set to null. If you must keep the original synthetic event around, use event.persist(). See https://fb.me/react-event-pooling for more information.

@rawnly
Copy link
Author

rawnly commented Aug 12, 2019

// My selectable component
const Selectable = createSelectable(
    ({ children, selectableKey, selected }) => (
      <li
        onClick={(e) => {
          console.log(e)
        }}
        style={{
          color: selected ? "white" : "black",
          background: selected ? "#ddd" : "#fafafa",
          listStyleType: "none",
          padding: "5px 10px",
          margin: "5px 0",
          borderRadius: 10,
          border: "1px solid #ddd"
        }}
      >
        {children}
      </li>
    )
  );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant