ReactJS Tutorial for Beginners -7

React

Welcome to part-7 of the series. You can find part-6 here. We will first learn about passing data from children to parent component.

Methods as props

In react we generally pass data(or props) from parent component to child component. But if we want to pass props from Child to Parent component, we need to pass methods.

We will create a class based component ParentComponent inside components folder. It have a local state of parentName and a greetParent(), which will show an alert containing this state.

In the render part, we are simply calling a ChildComponent.

ParentComponent

You can read the rest of the article from my site. Link for the same is below.

https://thewebdev.tech/react-basics-7

This completes part-7 of the series. You can find part-8 here.

--

--

--

Founder TWD, JavaScript & ReactJS Trainer, Youtuber, Blogger

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Some Useful Js Shorthand

How to get started debugging NodeJS applications with ndb

The Impact of Blockchain Technology Part 3: Smart Contracts Developer Tutorial with React

YouTube Video | CSS3 in 10 days — Day 3

Integrating styled forms in React

React Hooks Tutorial | Create YouTube Player -1

🤑 Get a chance to win 170 USDT and 700 PMD by just inviting friends to PokeMineG

Hoisting: An overlooked term in JavaScript?

Image from https://pixabay.com/vectors/panda-confused-questions-shrug-303949/

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
Nabendu Biswas

Nabendu Biswas

Founder TWD, JavaScript & ReactJS Trainer, Youtuber, Blogger

More from Medium

3 React Hooks You Should Not Miss in 2022

How to use react clean-up function with example

React Tutorial — Learn React in 5 hours — Part 5

Linear-Gradient Underline Text