-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Is it possible to hide a particular tab in TabBar from inside a scene? #1247
Comments
@dragfire You have to write your own action and dispatch it. You also need to add action handling in you custom reducer. |
Do I have to use redux/flux for this? https://github.com/aksonov/react-native-router-flux/blob/master/docs/REDUX_FLUX.md#reduxflux |
You can import Reducer from react-native-router-flux, and implement it like this: const reducerCreate = params => {
const defaultReducer = new Reducer(params);
return (state, action) => {
switch (action.type) {
case '*YOUR_ACTION_NAME*':
....manipulations with the state here....
return state;
default:
return defaultReducer(state, action);
}
};
}; and then call it this way: ACTIONS.*YOUR_SCENE_NAME*({ type: '*YOUR_ACTION_NAME*' }); |
Thank you @ArtemX9 |
@ArtemX9 I've implemented the reducer as you suggested. Everything is working as I want but there is a Here's my custom reducer: const reducerCreate = params => {
const defaultReducer = new Reducer(params);
return (state, action) => {
switch (action.type) {
case CustomActions.REMOVE_TWO_TABS:
let childrens = state.children;
childrens[1].children.splice(1, 2);
console.log('CHILDRENS:', childrens);
return Object.assign({}, state, childrens);
default:
return defaultReducer(state, action);
}
};
}; Is it a false-positive or am I doing something wrong? |
@dragfire try to clone |
Ok thanks! |
@dragfire I always have an error at P/s: I want to change Tabbar title when pressing a button
|
I have 5
Tabs
inTabBar
and I would like to manipulate them from inside aScene
.Is it possible to manipulate them using
Actions.refresh
?The text was updated successfully, but these errors were encountered: