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

fix(Panel): onResize missing prevMixedSizes on first render #209

Closed

Conversation

psychedelicious
Copy link
Contributor

Panel's onResize callback had prevMixedSizes undefined on first render.

  • Fall back to its mixedSizes when it is nullish
  • Add test for this case

Closes #208

`Panel`'s `onResize` callback had `prevMixedSizes` undefined on first render.

- Fall back to its `mixedSizes` when it is nullish
- Add test for this case
Copy link

vercel bot commented Nov 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-resizable-panels ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2023 5:38am

@psychedelicious
Copy link
Contributor Author

Why the test is failing a bit beyond me. I'm happy to try and fix it, but I'd need some direction. May not have really fixed the issue correctly of course.

@psychedelicious
Copy link
Contributor Author

Superseded by #212

bvaughn pushed a commit that referenced this pull request Nov 14, 2023
It is `undefined` on first render.

Closes #208 
Context #209

FWIW, `noUncheckedIndexedAccess` in tsconfig would. have caught this, but it also catches a whole heck of a lot more.
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

Successfully merging this pull request may close these issues.

PanelOnResize arg prevMixedSizes typed as required but is not present on init
2 participants