![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
preact-head-tag
Advanced tools
A tiny ssr-compatible preact component for managing head with preact-portal
A very tiny SSR-compatible head component for Preact using preact-portal.
It's around 1.5 kB including preact-portal and only ~500 bytes by itself.
Heavily inspired by react-head by tizmagic.
npm install preact-head-tag
import { h, Component } from "preact";
import HeadTag from "preact-head-tag";
const HelloWorld = () => (
<div>
<HeadTag tag="title">About this website</HeadTag>
<HeadTag tag="meta" name="example" content="whatever" />
<h1>Hello world!</h1>
</div>
);
// Alternatively you can use the following components for convenience:
import { Title, Meta, Style, Link } from "preact-head-tag";
const HelloWorld = () => (
<div>
<Title>About this website</Title>
<Meta name="example" content="whatever" />
<h1>Hello world!</h1>
</div>
);
import { h } from "preact";
import renderToString from "preact-render-to-string";
import { TagCollector } from "preact-head-tag/server";
const headTags = [];
// Wrap you App component in the TagCollector
const app = renderToString(
<TagCollector headTags={headTags}>
<App store={store} url={req.url} />
</TagCollector>
);
// Put the extracted headTags inside the head of the html.
// headTags is an array of strings so use headTags.join("")
res.send(`
<!doctype html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
${headTags.join("")}
</head>
<body>
<div id="root">${app}</div>
</body>
</html>
`);
MIT
FAQs
A tiny ssr-compatible preact component for managing head with preact-portal
The npm package preact-head-tag receives a total of 0 weekly downloads. As such, preact-head-tag popularity was classified as not popular.
We found that preact-head-tag demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.