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 ...

A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes

 Hi,



I was working in a react native project, when i opened my react native project in android studio , ran the project by executing npm start command,and do gradle sync successfully and ran the app on simulator,immediately  i got an error 

ERROR  Invariant Violation: "FrontEnd" has not been registered. This can happen if:

* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.

* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes 

I was confused a long time How to solve the issue.I tried a lots of methods like Clean Project Rebuild Project etc .Later i found that i was opening android folder of wrong  react native project in android studio.That is why i got the error A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes 


So in order to fix  Invariant Violation: project folder name  has not been registered error ,make sure that you have opened correct android folder in android studio.

I hope this small article help you to fix Invariant Violation error in react native.