aksonov / aksonov/react-native-router-flux

How to modularize router scenes?

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

Mô tả

### Version
Tell us which versions you are using:

- react-native-router-flux v4.0.6
- react v16.5
- react-native v0.55

### Expected behaviour

Attempting to break huge scene component into separate smaller components, and importing them into the body of the root scene component. Expect to do be able to do something like this:

```
import HomeTab from './HomeTab'
...

return (








```
where `HomeTab` looks like:
```
import React, { Fragment, Component } from 'react';
import { Scene } from 'react-native-router-flux';
import ExplorePage from '../../components/pages/ExplorePage/ExplorePage';
import styles from './styles';
import dictionary from '../../components/constant/dictionary/en_us';
...

export default class HomeTab extends Component {
render() {
return (
} title={dictionary.DISCOVER}>

...

);
}
```
And my expected behavior is the main scene component would pull in this fragment of a scene and render accordingly.

### Actual behaviour
![screenshot_20190209-112352_expo](https://user-images.githubusercontent.com/6694224/52525374-8830f000-2c5d-11e9-9d7d-69141d17711c.jpg)

### Steps to reproduce
For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.
1.
2.
3.

### Reproducible Demo

Please provide a minimized reproducible demonstration of the problem you're reporting.

Issues that come with minimal repro's are resolved much more quickly than issues where a maintainer has to reproduce themselves.

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

Mở hướng dẫn đóng góp

Đá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.