aksonov / aksonov/react-native-tabs

How to use it with react-native-router-flux?

Đang mở
#27 6 bình luận 3 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
727
Fork
112
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello,

quite new to the react scene and I am struggling to understand some flow...

I have an index page where I registered all the scenes, as suggested on the router-flux docs:

```
const scenes = Actions.create(











);
```

And then I call

```
return (

);
```

in my redner method... works fine...

but then on the page
TraineeDetails I have a Tabbar on the top... and I would like to display content from the assigned components

The code in my TraineeDetails:

```

/**
* Trainee details
*/
'use strict';

import React, { Component } from 'react';
import { StyleSheet, View, StatusBar, Image } from 'react-native';

import Icon from 'react-native-vector-icons/MaterialIcons';
import Tabs from 'react-native-tabs';
import Config from '../../constants/Config';

import {Actions} from 'react-native-router-flux';

class TraineeDetails extends Component {

constructor(props, context) {
super(props, context);
this.state = {
tab: 'today'
};
}

componentDidMount(){
StatusBar.setBackgroundColor(screenConfig.primaryColor, true);
}

goBack(){
Actions.Trainees();
}

onSelectTab(el){
console.log('PROPS: ', el.props);
console.log('NAME: ', el.props.name);
console.log('VIEW: ', el.props.view);

//Actions[el.props.view]({data:this.props.data});

this.setState({tab: el.props.name});
this.setState({tabContent: el.props.view});
}

render() {

const Player = this.props.data;
return (










{/* NEED THE TAB CONTENT HERE */}



);
}
}
// ..... and so on

```

How do I insert the component and re-render it each time the tab is tapped?

In your example you just change a variable and text on the same scene... would be helpful if you could add a container and change the content (loaded dynamically from a component)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.