React JS FAQs for Beginners Pt.1

Photo by Ferenc Almasi on Unsplash

How to create a react app

What are components?

What is State?

What are Hooks?

Photo by Mael BALLAND on Unsplash

Hooks are a fairly new addition to React. They allow you to use state and other react features without writing class components. Hooks are optional. You don't have to use functional components if you don't want to. You can have a fully functional app with just class components. Hooks are backwards compatible. So if you wanted to update your current code you can with out worrying about breaking things.

There’s lots of different hooks you can use I personally have found useEffect() and useState() to be the most useful.

useEffect() allows you to use a function/ preform an action immediately once a component is rendered

useState() allows you put your return value into state. So that you can youse it in your component.

Here’s a list of some of the most commonly used hooks:




A Software Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store