diff --git a/snippets/Mailto.md b/snippets/Mailto.md new file mode 100644 index 000000000..24b5740dc --- /dev/null +++ b/snippets/Mailto.md @@ -0,0 +1,29 @@ +### Mailto + +Renders a link formatted to send an email. + +Destructure the component's props, use `email`, `subject` and `body` to create a `` element with an appropriate `href` attribute. +Render the link with `props.children` as its content. + +```jsx +function Mailto({ email, subject, body, ...props }) { + return ( + + {props.children} + + ); +} +``` + +```jsx +ReactDOM.render( + + Mail me! + , + document.getElementById("root") +); +``` + + + +