Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

Enable dynamic sliding tabs #361

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

gwmccull
Copy link

@gwmccull gwmccull commented Jan 7, 2017

This project builds off of #337 (since it edits the same file, I didn't want to worry about conflicts down the road).

It allows the user to update the list of tabs in their app and have the change reflected in the horizontal tabs

Here's an example of the code from the render function in my app:

<SlidingTabNavigation
	id="sliding-tab-navigation"
	navigatorUID="sliding-tab-navigation"
	initialTab="shop"
	renderLabel={this.renderLabel}
	barBackgroundColor="#fff"
	indicatorStyle={componentStyles.tabIndicator}
	tabBarScrollEnabled={true}
>
	{
		this.state.tabs.map((tab) => {
			return (
				<SlidingTabNavigationItem
					id={tab.id}
					key={tab.id}
				>
					{tab.component()}
				</SlidingTabNavigationItem>
			);
		})
	}
</SlidingTabNavigation>

Later, the app can just update the state with a new set of tabs and the change will be reflected in the UI.

@satya164
Copy link
Contributor

satya164 commented Jan 7, 2017

Hey! Thanks for the PR. Please take a look at https://github.com/exponent/ex-navigation#an-important-note-about-the-future

@gwmccull
Copy link
Author

gwmccull commented Jan 7, 2017

@satya164 thanks. Any idea if these issues will already be resolved in the new repo?

I have a nav project that needs to begin immediately and will probably be wrapping up near the end of the month

Thanks

@satya164
Copy link
Contributor

satya164 commented Jan 7, 2017

@gwmccull Currently dynamic tabs are not possible in React Navigation. But we're actively exploring ideas.

@satya164
Copy link
Contributor

satya164 commented Jan 7, 2017

@gwmccull For your project you can directly use https://github.com/satya164/react-native-tab-view for now.

@gwmccull
Copy link
Author

gwmccull commented Jan 7, 2017

@satya164 good to know. We're planning to migrate once the new lib comes out.

Sounds like we may need to plan extra time to roll our own dynamic tab system :-)

@satya164
Copy link
Contributor

satya164 commented Jan 7, 2017

@gwmccull : Sounds like we may need to plan extra time to roll our own dynamic tab system

Hopefully it won't take much time. All the best!

@gwmccull
Copy link
Author

gwmccull commented Jan 7, 2017

@satya164 I'm working with a great team of React Native developers and we're pretty excited to work with the new navigation lib.

Do you know if things are getting to the point where outside groups could contribute to its development?

@satya164
Copy link
Contributor

satya164 commented Jan 7, 2017

@gwmccull I think we're pretty close. Keep an eye out for the announcement :D

@gwmccull
Copy link
Author

gwmccull commented Jan 7, 2017

@satya164 that's great! Have a good weekend

@maxschmeling
Copy link

Where will an announcement about the new lib be made? Is there any way to follow along with what's happening?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants