Skip to content

Instantly share code, notes, and snippets.

@naveedahmed986
Last active January 14, 2021 11:09
Show Gist options
  • Save naveedahmed986/bfda9c1935a03d87fe6e03add73fcb86 to your computer and use it in GitHub Desktop.
Save naveedahmed986/bfda9c1935a03d87fe6e03add73fcb86 to your computer and use it in GitHub Desktop.
react-parent-child-data-binding
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