Last active
January 14, 2021 11:09
-
-
Save naveedahmed986/bfda9c1935a03d87fe6e03add73fcb86 to your computer and use it in GitHub Desktop.
react-parent-child-data-binding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
export default function Child(props) { | |
return ( | |
<div className="Child"> | |
<h4>Child</h4> | |
<input | |
placeholder="input to parent..." | |
onChange={(e) => props.fromChild(e.target.value)} | |
/> | |
<br /> | |
<span>{props.toChild}</span> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment