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') +); +```