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

How to validate condition in render return using react native?

$
0
0

In my scenario, I am trying to create a validation logic within render return. I have asycstorage value I am getting value and validate by using below code

render() {    const value = AsyncStorage.getItem(‘username’);  return ({value !== null &&        (<View……………..</View> )})}

Above code not validating also based on validation result it is not rendering. If value not equal to null mean, I need to render view. How to achieve this?


Viewing all articles
Browse latest Browse all 6212

Trending Articles



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