Is there any chance to use a component as a global ActivityIndicator which has transparent color and had been created by me on React-Native?
Details:
- I use a redux store to update the UI. So I intend to show an ActivityIndicator by updating the store.
- I've created an
ActivityIndicator
component with nameActIndicator
. - I have a main
App
component that contains the app. - I have a
Root
component that wraps theActIndicator
andApp
components.
The ultimate code of render
method of Root
component looks like the following:
render() {
if (this.state.showActivityIndicator) {
return(
<ActIndicator>
<App />
</ActIndicator>
)
}
return (</App>)
}
I've tried several methods but I can not be successful.
I guess my brain is stopped.
I also guess there may be a logic mistake.
I used to wrap whole container with HOC and with redux action to set on start pending prop true and on success or fail to set on false so this prop will be consumed by HOC and indicator will be displayed only when pending is set on true.
In container you have to wrap component in connect