RealOrangeOne / react-native-busy-indicator

A simple, event controlled, busy indicator for react-native
MIT License
94 stars 41 forks source link

Need two loader in one component. Is it possible? #9

Closed ycpatel813 closed 7 years ago

ycpatel813 commented 7 years ago

Hello, I have login scene and i am using react-native-busy-indicator and it works fine for me. But for forget password I have created modal. can i use both loader differently?

Thank you.

RealOrangeOne commented 7 years ago

You can't no. but you shouldnt need to. You can control the content when you load it, so just render the component at as close to the top level as you can, then call the event that shows it with whatever text you want. You can call it in as many different places as you want, so there's no real reason to need 2

ycpatel813 commented 7 years ago
         <View style={styles.container}>
                   <Modal
                            // Forget Password code here
                          <BusyIndicator/>
                   </Modal>

                  // Login code here
                  <BusyIndicator/>
        </View>

How can i achieve in this code. can you help me?

Thank you.

RealOrangeOne commented 7 years ago

I dont see a reason you'd want to show the spinner inside the modal. you'd want it over the whole page. You'd only have the lower one, and just trigger it in both cases with different text. it'll always fill out the screen when you show it

ycpatel813 commented 7 years ago

When i use only lower BusyIndicator it is hide behind my modal. so i need two busy loader.

RealOrangeOne commented 7 years ago

You dont need 2, you just need to render the BusyIndicator higher up in your component stack. The best thing to do it just always render it right at the top level, in index.js or something even. Then call it lower down. It should then show over your modal.

RealOrangeOne commented 7 years ago

Closing. Issue caused by outside library