-
Notifications
You must be signed in to change notification settings - Fork 332
Open
Description
Bug report π
Version & Environment
- Version of browser: Chrome 113.0.5672.126
- Version of
geist-ui/core: 2.3.8
Expected Behaviour
GeistBackdrop should not re-render.
I'm using @welldone-software/why-did-you-render which notifies me about potentially avoidable re-renders.
It seems that we should use useCallback for instance on closeFromBackdrop:
geist-ui/components/modal/modal.tsx
Lines 78 to 81 in b48b823
| const closeFromBackdrop = () => { | |
| if (disableBackdropClick) return | |
| closeModal() | |
| } |
Actual results (or Errors)
GeistBackdrop
{GeistBackdrop: Ζ} 'Re-rendered because of props changes:'
props.onClick
different functions with the same name. (more info at http://bit.ly/wdyr02)
{prev onClick: Ζ} '!==' {next onClick: Ζ}
props.onKeyDown
different functions with the same name. (more info at http://bit.ly/wdyr02)
{prev onKeyDown: Ζ} '!==' {next onKeyDown: Ζ}
props.onKeyDownCapture
ddifferent functions with the same name. (more info at http://bit.ly/wdyr02)
{prev onKeyDownCapture: Ζ} '!==' {next onKeyDownCapture: Ζ}
props.onKeyPress
different functions with the same name. (more info at http://bit.ly/wdyr02)
{prev onKeyPress: Ζ} '!==' {next onKeyPress: Ζ}
props.onKeyPressCapture
different functions with the same name. (more info at http://bit.ly/wdyr02)
{prev onKeyPressCapture: Ζ} '!==' {next onKeyPressCapture: Ζ}
props.onKeyUp
different functions with the same name. (more info at http://bit.ly/wdyr02)
{prev onKeyUp: Ζ} '!==' {next onKeyUp: Ζ}
props.onKeyUpCapture
different functions with the same name. (more info at http://bit.ly/wdyr02)
{prev onKeyUpCapture: Ζ} '!==' {next onKeyUpCapture: Ζ}
props.children
different React elements (remember that the <jsx/> syntax always produces a *NEW* immutable React element so a component that receives <jsx/> as props always re-renders). (more info at http://bit.ly/wdyr02)
{prev children: {β¦}} '!==' {next children: {β¦}}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels