Bolza
Bolza

Reputation: 1944

Recompose branch to render on top of wrapped component

If i have something like

compose(
  withData()
  branch(props => props.isLoading, renderComponent(()=><Spinner />))
)(DataList)

what will happen is that the Spinner component will replace DataList in the DOM while loading.

How can i have the Spinner be rendered in addition to DataList? Is there some kind of common pattern i can use?

Live Example

https://codesandbox.io/s/recompose-branch-forked-zlyuo

Basically what i'd want in this example is to see both 'branched component' and 'wrapped component' at the same time when showBranched is true

Upvotes: 0

Views: 138

Answers (0)

Related Questions