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

Fetch is not defined error fixed in Node JS ReferenceError fetch api call error Solved




Dear friends, In this small article,i am trying to explain How to fix the error Fetch is not defined error  in Node JS or ReferenceError  fetch api call error in Node JS. As  a beginner in Node JS programming, I was confused with this error.I tried to use fetch in Node JS but i got the error ReferenceError Fetch is not defined.


In order to fix this fetch reference error in Node JS,we have to understand that fetch method is not implemented  in Node JS by default.That is why,when we try to use fetch directly in Node JS,we get the error ReferenceError Fetch is not defined




So for making external end points API calls,we have to use third party packages in Node JS.In this small video,I explain How to fix the Fetch is not defined error by using a npm package node-fetch.By installing node-fetch npm package,we can import fetch method from node-fetch library and run fetch method in Node JS without any referenceError like fetch is not defined.


So i hope,this basic video  explanation helped you to fix  Fetch is not defined error  in Node JS.