diff --git a/README.md b/README.md index 0eec1d3d..5efaf5d6 100644 --- a/README.md +++ b/README.md @@ -4917,13 +4917,25 @@ 218. ### How to pass numbers to React component? - You should be passing the numbers via curly braces({}) where as strings in quotes + We can pass `numbers` as `props` to React component using curly braces `{}` where as `strings` in double quotes `""` or single quotes `''` ```jsx - React.render( - , - document.getElementById("container") - ); + import React from "react"; + const ChildComponent = ({ name, age }) => { + return ( + <> + My Name is {name} and Age is {age} + + ); + }; + const ParentComponent = () => { + return ( + <> + + + ); + }; + export default ParentComponent; ``` **[⬆ Back to Top](#table-of-contents)**