like so,
export withNavigation({ Provider, Consumer })
but it throws an error, how may i do that ?
I suppose you should name export or make default export
More code is needed. This is just one line. Not enough
You need to create your own HOC. Remember, a HOC is a function that receives a Component and returns a Component. This may work: const withProps = newProps => Component => props => (<Component {...newProps} {...props} />) And you use it like withProps({ Provider, Consumer })(Component)
Обсуждают сегодня