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
Site Editor: Fix deprecation console error in top toolbar #55678
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
59f7fdd
Site Editor: Fix deprecation console error in top toolbar
t-hamano 1f36d2f
Merge branch 'trunk' into quality/use-render-prop
t-hamano 952f3d9
use custom component
t-hamano cccb544
Wrap `NavigableToolbar` in a `motion.div`
t-hamano b0889c1
Merge branch 'trunk' into quality/use-render-prop
t-hamano 6be77e0
Merge branch 'trunk' into quality/use-render-prop
t-hamano File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if the
as
prop was part of the public API of theNavigableToolbar
component. But if it was, we should probably re-implement that withinNavigableToolbar
.Something like this may work:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review!
It appears that the
as
prop in theNavigableToolbar
component is not defined and is simply received as a remainder of the defined props. In this case, I thought it would be better not to re-implement internally fromas
prop torender
prop, but what do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a few things happening here:
Toolbar
technically never supported theas
prop: thefalse
here in fact marks the component as non polymorphicas
prop worked (even if technically not supported)Toolbar
was recently refactored fromreakit
toariakit
, which introduced the deprecation warning for theas
propSo, technically
Toolbar
doesn't support neitheras
norrender
. On top of that, looking at the implementation ofNavigableToolbar
, depending on theisAccessibleToolbar
prop, it could also render aNavigableMenu
, which would ignore theas
prop completely.It just seems to me that the best choice here is to find a different way to animate the header without passing the
as
prop (orrender
prop) toToolbar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the other way around?
Ref: https://www.framer.com/motion/component/#custom-components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we could try that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your ideas. I have tried various implementations based on the documentation, but so far nothing has worked. The editor crashes with an error logged in the browser console, or the animation doesn't work.
I'll try to find another approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about wrapping
NavigableToolbar
in amotion.div
?Or simply adding the animation via SCSS ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end, I did this approach. The layout and animations should remain the same.