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

Add tab dinamicaly #35

Closed
isergey opened this issue Aug 31, 2015 · 3 comments
Closed

Add tab dinamicaly #35

isergey opened this issue Aug 31, 2015 · 3 comments

Comments

@isergey
Copy link

isergey commented Aug 31, 2015

Hello! Thank you for the library! I have a question about dynamic addition of tabs. In pseudo code it's looks like this:

handleAddProfileClick() {
    this.refs.tabs.add(
     <UserProfileTab userId="123" />
    );
},
handleAddSettingsClick() {
    this.refs.tabs.add(
     <Settings  />
    );
}

It is also important that other tabs are not redrawn (kept its state).
How about tab closing?
Thanks a lot!

@mzabriskie
Copy link
Member

I have an example of dynamically adding/removing tabs here https://github.com/mzabriskie/react-tabs/tree/master/examples/dyno

@isergey
Copy link
Author

isergey commented Sep 1, 2015

Thank you!

@isergey isergey closed this as completed Sep 1, 2015
@themre
Copy link

themre commented Oct 14, 2016

Thanks for this! However I would like to add tabs dynamically by passing certain Component inside like:

addTab("tab text", <MyComponent />);

Any way to achieve this?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants