Code Monkey home page Code Monkey logo

preact-head's Introduction

Preact-head

Standalone, declarative <Head /> for Preact.

Supports both client and server-side rendering.

Example

<Head>
  <title>{state.title}</title>
  <meta name="Whatever" content={state.count} />
</Head>

Installation

yarn add preact-head

Credit

This was inspired by and ported from next.js & react-declarative-head with adjustments to make it work with well with Preact.

License

MIT

preact-head's People

Contributors

babie avatar matthewmueller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

preact-head's Issues

Types for TypeScript

I'm using TypeScript. I would be grateful if you could add a type declaration file #3 .

Uncaught Error: getting vnode.nodeName is deprecated, use vnode.type

Uncaught Error: getting vnode.nodeName is deprecated, use vnode.type
import Head from 'preact-head';

const App: FunctionalComponent = props => {

  return (
    <div id="app">
      <Head>
        <meta name="Whatever" />
        <script src="https://cdn.jsdelivr.net/instantsearch.js/1/instantsearch.min.js"></script>
      </Head>
    </div>
  );
};

export default App;

Project created with preact-cli:

$ preact info
Environment Info:

  System:
    OS: macOS 10.15.3
    CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
  Binaries:
    Node: 13.11.0 - /var/folders/wz/2jcpmrzn10zf5vdt040rlgpnlw_5kt/T/yarn--1585667594088-0.7880985376069529/node
    Yarn: 1.22.4 - /var/folders/wz/2jcpmrzn10zf5vdt040rlgpnlw_5kt/T/yarn--1585667594088-0.7880985376069529/yarn
    npm: 6.13.7 - /usr/local/bin/npm
  Browsers:
    Chrome: 80.0.3987.149
    Firefox: 74.0
    Safari: 13.0.5
  npmPackages:
    preact: ^10.3.3 => 10.3.3
    preact-cli: ^3.0.0-next.19 => 3.0.0-rc.7
    preact-router: ^3.2.1 => 3.2.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.