Passing state of a class to a Modal in React Native

Asked

Viewed 75 times

-2

I am starting in React Native and I have a problem, I will put the prints to make it easier. I have a screen called Questions, which has an initial state, and this screen opens a modal called Attention (as in the image below) inserir a descrição da imagem aqui

I need to pass this variable post, which is in the state of the screen Questions and will be changed on this screen, to the Modal Attention, but I do not know how to do it. I’ve tried some things and nothing worked. Someone knows what they should use for this?

1 answer

0


Man, I might be wrong because I don’t quite understand your problem, but by your question,:

<Atencao posto={this.state.posto} />

And then only access in modal by props, if that was not the problem, give a reply there to try to explain better.

  • That was it. Now I think it will work. It was very simple and I looking for elaborate thing kkkk Mt thank you

  • @Johannarouca show! any problem can give a mention there and we try to solve.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.