-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
[Tabs] Overhaul Tabs API #245
Conversation
cfba06b
to
868e1bd
Compare
bfbdd55
to
bc6a136
Compare
8b288b8
to
9e8baa3
Compare
I used |
const [, forceUpdate] = React.useState({}); | ||
|
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 an existing useForceRender
util
const prehydrationScript = ` | ||
(function() { | ||
let indicator = document.currentScript.previousElementSibling; | ||
if (!indicator) { |
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 think it may be better to store the source of this in its own file (unused) and use a minified version here?
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 created a utility to minify and inline scripts in 30412c2
...other | ||
} = props; | ||
const render = renderProp ?? defaultRenderFunctions.span; | ||
const [instanceId] = React.useState(() => Math.random().toString(36).slice(2)); |
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.
useId
util hook?
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.
Doesn't work during SSR in React 17 :(
* Callback invoked when new value is being set. | ||
*/ | ||
onChange?: (event: React.SyntheticEvent, value: any) => void; |
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.
As discussed, it should be better to prefer different prop names like onValueChange
that passes in the value
first.
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.
Ready to 🚀 on my side |
44562c3
to
b73f72f
Compare
1f9fc7e
to
e902605
Compare
selectionFollowsFocus
prop toactivateOnFocus
and moved it to TabsList.loop
prop to the Tabs.keepMounted
prop to the TabPanelTo do:
value
nordefaultValue
is setkeepMounted
prop on TabPanelsSliding tab panels-> in a separate PRScrollable tab list-> in a separate PRPreview:
Closes #212
Closes #81