Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6213

Saving something in app object to address it within the components

$
0
0

I remember it is somehow possible to access to the application instance within any of the react native components. How to actually do that?

Asking this because sometimes it seems to be more convenient than storing some objects in custom global storage or in the AsyncStorage, for example.

The hypothetical example of what I am asking:

class SomeComponent extends Component {    constructor(props) {        super(props);        this.Application.some_object_saved_as_an_attribute_of_the_application.doStuff();    }}

Viewing all articles
Browse latest Browse all 6213

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>