Created
December 22, 2022 18:31
-
-
Save Tc-001/8dd89f422212371a99a658960f9ae0bb to your computer and use it in GitHub Desktop.
Add doctype in honojs's JSX layout
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
| function DoctypeComponent() { | |
| let s = new String("<!DOCTYPE html>") as any | |
| s.isEscaped = true | |
| return s | |
| } | |
| export const Layout = (props: { children?: string }) => ( | |
| <Fragment> | |
| <DoctypeComponent /> | |
| <html lang="en"> | |
| ... | |
| </html> | |
| </Fragment> | |
| ) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank me later lol, this took some reading to figure out
Fun fact, you can't do
dangerouslySetInnerHTMLon Fragment