Skip to content

Create an imperative API for TabController for setting tab imperatively #2197

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

Merged
merged 2 commits into from
Aug 22, 2022

Conversation

ethanshar
Copy link
Collaborator

Description

Create an imperative API for TabController for setting tab imperatively

Changelog

Create an imperative API for TabController for setting tab imperatively

useSafeArea = false,
children
}: PropsWithChildren<TabControllerProps>) {
const TabController = React.forwardRef((props: PropsWithChildren<TabControllerProps>, ref: React.Ref<any>) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this can resolve the bottom ignores, you decide if it's better:

// @ts-expect-error
const TabController: ForwardRefExoticComponent<
  PropsWithoutRef<TabControllerProps> & RefAttributes<TabControllerImperativeMethods>
// eslint-disable-next-line max-len
> & TabControllerStatics = React.forwardRef((props: PropsWithChildren<TabControllerProps>, ref: React.Ref<TabControllerImperativeMethods>) => {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It doesn't solve the bottom ignores

Copy link
Collaborator

Choose a reason for hiding this comment

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

Strange, it does for me. let me know if you want to look at this together

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe I did something wrong or misunderstood..
Do you want to create a (separate) PR with what u meant?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It works for me, but I think it breaks the props, so forget about it

Co-authored-by: Miki Leib <38354019+M-i-k-e-l@users.noreply.github.com>
@ethanshar ethanshar requested a review from M-i-k-e-l August 21, 2022 07:20
@ethanshar ethanshar merged commit 1d2358c into master Aug 22, 2022
@ethanshar ethanshar deleted the feat/TabController_imperativeAPI branch April 2, 2024 06:39
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.

2 participants