Skip to main content

Featured post

How to Insert line break in Text component in React Native

Hi, I was developing an application in react native.I have to handle lots of text data in this small react native application.I have used  Text component in react native many times. While working on this application,i had a requirement to display some text content with line breaks.I will explain it clearly with an example.I want to display a text as shown below  Welcome Please subscribe my channel I wrote react native code as shown below <View> <Text> Welcome Please subscribe my channel </Text> <View> When i run these lines of code,It will display text as shown below Welcome Please subscribe my channel   - instead of displaying in two lines with line break,it displays in a single line.So i have to find a solution to insert line break in Text component in React Native.After lots of research,i found a clean solution as shown below <View> <Text> Welcome{"\n"} Please subscribe my channel </Text> <View> Here ...

Render Error Can't find variable View Can't find variable Text Can't find StyleSheet React Native

 


Hi, When i started to study react native first time,I faced the error   Render Error Can't find variable View ,Render Error Can't find variable Text , Render Error Can't find StyleSheet .But It was a simple mistake i did when i write react native codes.In this article I will explain How to fix Render Error Can't find variable View ,Render Error Can't find variable Text , Render Error Can't find StyleSheet. Because as i mentioned above, It may happen when we start write react native codes as a beginner.As a beginner ,i faced this  Render Error related to  View,Text StyleSheet etc.





As i explained in the video,if we forget to import View ,Text ,StyleSheet etc from react-native library then we will get Render Error Can't find variable View Can't find variable Text Can't find StyleSheet So always import View ,Text ,StyleSheet etc from react-native before using them in your react native component.