Skip to content

3: Сделать навигаторы#2

Open
Mafark wants to merge 8 commits intomasterfrom
add-navigators
Open

3: Сделать навигаторы#2
Mafark wants to merge 8 commits intomasterfrom
add-navigators

Conversation

@Mafark
Copy link
Copy Markdown

@Mafark Mafark commented May 9, 2018

No description provided.


import {createStore} from '../lib/store';
import HomeScreen from './HomeScreen';
// import HomeScreen from './HomeScreen';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

так, комменченый код давайте сразу выпиливать

nav,
});

export default AppReducer;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

редюсеры давайте хранить в отдельных файлах с папке reducers, то есть это перенести в reducers/navigation а в reducers/index только склеивать их через combineReducers

const mapStateToProps = state => ({
nav: state.nav,
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

то что лежит в компонентах никогда не конектится к стору

Copy link
Copy Markdown
Collaborator

@AntonyFomichev AntonyFomichev May 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static propTypes = {
dispatch: PropTypes.func.isRequired,
nav: PropTypes.object.isRequired, // eslint-disable-line
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не надо это правило дизейблить, не используем PropTypes.object, нужно прописывать через PropTypes.shape именно те поля которые используются в компоненте, если структура повторяется несколько раз, выносить в отдельный файл, например lib/prop-types.js
или constants/prop-types.js

@Mafark Mafark force-pushed the add-navigators branch 3 times, most recently from 80f9fbf to 768aa6e Compare May 13, 2018 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants