From a2eaa2fbe5201868988f3d5ee0ff23c0b1073164 Mon Sep 17 00:00:00 2001 From: Azan Bin Zahid <47540683+azanbinzahid@users.noreply.github.com> Date: Sun, 4 Oct 2020 02:07:37 +0500 Subject: [PATCH] Create Callto.md --- snippets/Callto.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 snippets/Callto.md diff --git a/snippets/Callto.md b/snippets/Callto.md new file mode 100644 index 000000000..5dd76cd6c --- /dev/null +++ b/snippets/Callto.md @@ -0,0 +1,26 @@ +--- +title: Callto +tags: components,beginner +--- + +Renders a link formatted to dial a phone number. + +- Destructure the component's props, use `phone` to create a `` element with an appropriate `href` attribute. +- Render the link with `children` as its content. + +```jsx +const Callto = ({ phone, children }) => { + return ( + {children} + ); +}; +``` + +```jsx +ReactDOM.render( + + Call me! + , + document.getElementById('root') +); +```