futurice / futurice/pepperoni-app-kit

Attaching props to a navigation dispatch

Open
#83 2 comments 0 reactions 0 assignees View on GitHub
documentation
Dominant language
JavaScript
Stars
4.6k
Forks
631
PR merge metrics
No merged PRs in 30d

Description

Redux navigation is cool, but unfortunately I don't get it easily.

So, I'm pushing a new view:
`this.props.dispatch(NavigationState.pushRoute({key: 'Project'})`

The Project view needs an **id** prop to be able to find the wanted project in the store. Where should I put the id in the dispatch?

The example views (color and counter) don't get any input via the dispatch, but only reads "singleton" state from the store, i.e. `state.getIn(['counter', 'value'])`

I need to `state.getIn(['project', id])` to load the desired project.

Should I simply `this.props.dispatch(NavigationState.pushRoute({key: 'Project', id: 12})`?
How would I get hold of the id value in my ProjectViewContainer?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing NavigationState.pushRoute from the dispatch example to ProjectViewContainer, and inspect how navigation state is exposed to the container. Clarify the supported way to pass an id and read it in the Project view; done means the issue documents or demonstrates that flow unambiguously.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.