How to solve CORS error in Node.js and React applicationsIn the previous article, I have explained how to deploy a Node.js application to Heroku. In this tutorial, we will be making use of the endpoint created there and see if we can use it in our React project. Project Setup Let's create a React project u...Aug 30, 2022·5 min read
How to write for loops in React JSXIn this tutorial, we will learn how to write loops inside JSX in React. Setting up the project Let's create a new React app using the following command: npx create-react-app react-for-loop Let's add some styling to the page in index.css: body { ma...Aug 27, 2022·3 min read
How to call the child component function from the parent component in ReactWhen you need to call a function declared in the parent component from a child component, it is as easy as passing it as a prop to the child component and calling it from the child component. However, when you want to call the other way around, thing...Aug 26, 2022·3 min read
How to pass props to a component in ReactWhat are props? Consider a function in any programming language. How do we pass values to the function? Using parameters. Props (properties) are similar to parameters. They are used to pass data from one component to another in React. Below is the si...Aug 25, 2022·7 min read
How to store and update arrays in React useState hookYou might have come across different use cases where you would want to store an array in the React state and later modify them. In this article, we will see different ways of doing it. Project setup Create a react project by running the following com...Aug 24, 2022·9 min read
How to work with radio buttons in ReactUnlike checkboxes, radio buttons always come in groups. Let it be selecting your gender or choosing the size of the Pizza. In this article, we will see how to render radio buttons in react and how to know which radio button is selected. First, let's ...Aug 23, 2022·2 min read
How to style React components using CSSYou might have come across different ways to style React components. In this article, we will discuss the most popular ways to do it and the advantages and disadvantages of using them. Inline Styling If you want to add a style quickly, you can make u...Aug 22, 2022·8 min read