From b9382db30bd1725298eb11dc4c7ba6ad9906349d Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 28 Jan 2019 20:10:51 +0200 Subject: [PATCH] Create Mailto.md --- snippets/Mailto.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 snippets/Mailto.md 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") +); +``` + + + +