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 1/2] 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') +); +``` From 9613280f2203f72cdb27d08c6c06de6ae9310872 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Fri, 27 Nov 2020 09:45:40 +0200 Subject: [PATCH 2/2] Update Callto.md --- snippets/Callto.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/snippets/Callto.md b/snippets/Callto.md index 5dd76cd6c..59782a7af 100644 --- a/snippets/Callto.md +++ b/snippets/Callto.md @@ -3,24 +3,20 @@ title: Callto tags: components,beginner --- -Renders a link formatted to dial a phone number. +Renders a link formatted to call a phone number (`tel:` link). -- Destructure the component's props, use `phone` to create a `` element with an appropriate `href` attribute. +- 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} - ); + return {children}; }; ``` ```jsx ReactDOM.render( - - Call me! - , + Call me!, document.getElementById('root') ); ```