Skip to content

Tag: jsx

How to use script tags in React?

I am pretty new to React and I wanted to try incorporating some pure Javascript in my React component. I have an html file of the script tags that I want to use which works, but obviously in React it is a little more complicated then just adding some script tags. From what I have been reading, it seems like

‘state’ is not defined no-undef

I use a tutorial to learn React and I got stuck pretty quickly. In the tutorial they use this code: And everything works great. But in my case, I get this error: srccomponentscounter.jsx Line 4:3: ‘state’ is not defined no-undef Search for the keywords to learn more about each error. After trying everything, …

React App – My alert window is showing up twice

I don’t understand why this is happening – I have an app that increments and decrements a counter when the buttons are pressed to display an increasing list of easter egg brands from a collection. When the counter reaches the max number of eggs in the collection I want a popup to appear saying &#8…