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

Use v8 react-button hooks in v0 button #15777

Closed
wants to merge 10 commits into from

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented Oct 29, 2020

⚠️ This PR is a WIP

Validating v8 hooks in v0. Please wait for review.

TODO

  • Run v8 examples and fix broken things (due to hook updates)

@@ -32,5 +32,8 @@ export const useButtonState = (draftState: ButtonState) => {
}
}

draftState.disabled = draftState['aria-disabled'] = draftState.disabled || draftState.loading;
// TODO: v0 buttons are not disabled while loading, removed `disabled = loading` logic here
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not disabling buttons while loading was intentional - while the UI is loading, it is useful to have the button still focused, because quite often, there is no other suitable place to move focus to.


export const renderImage = (state: ImageState) => {
const { slots, slotProps } = getSlots(state);

return <slots.root {...slotProps.root} />;
};

const mergeProps = makeMergeProps<ImageState>();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Add tests to show why we cannot rely on a static list of props to deeply merge.

@ecraig12345
Copy link
Member

@levithomason Guessing this can be closed now that we're taking a totally different approach?

@ecraig12345
Copy link
Member

Closing since we're no longer considering this approach

@levithomason levithomason deleted the feat/v8-hooks-in-v0 branch February 11, 2022 18:04
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.

None yet

4 participants