Last active
April 18, 2020 17:42
-
-
Save PuruVJ/95cb8dccd33e4c67d718e7dce8348c69 to your computer and use it in GitHub Desktop.
Helmet Usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, Prop, h } from '@stencil/core'; | |
import Helmet from "/path/to/helmet.tsx"; | |
@Component({ | |
tag: 'my-first-component', | |
}) | |
export class MyComponent { | |
// Indicate that name should be a public property on the component | |
@Prop() name: string; | |
render() { | |
return ( | |
<p> | |
My name is {this.name} | |
<Helmet> | |
<meta name="theme-color" content="#fefefe" /> | |
<title>Hello World</title> | |
{/* And any tags can be used in here. They would be put in <head>, or replaced if they already exists. | |
Note: The replacement will happen only for meta[name] tags as they are the most used ones | |
*/} | |
</Helmet> | |
</p> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment