kotlin-react-helmet

1.2.0 • Public • Published

npm license

Discord

kotlin-react-helmet

A Kotlin2js wrapper for react-helmet.

Usage

kotlin-react-helmet uses the same DSL provided by kotlin-react, and simply extends upon it in order to provide the functionality one might expect from the original react-helmet library:

fun main(args: Array<String>) {
    render(document.getElementById("root")) {
        helmet(title = "Hello from kotlin-react-helmet!")
        h1 { + "Hello, World!" }
    }
}

When rendered into a typical starter template, the following will be produced:

<html>
  <head>
    <title>Hello from kotlin-react-helmet!</title>
  </head>
  <body>
    <div id="root">
      <h1>Hello, World!</h1>
    </div>
  </body>
</html>

For more info on how react-helmet works, see their github repo's readme

Installation

With NPM

npm i kotlin-react-helmet

If you are using Intellij IDEA and create-react-kotlin-app, you can run the following to have your IDE resolve the library:

npm run gen-idea-libs

With Gradle

repositories {
    jcenter()
}
 
dependencies {
    compile "me.kgustave:kotlin-react-helmet:$kotlinReactHelmetVersion"
}

License

kotlin-react-helmet is licensed under the Apache 2.0 License

Copyright 2018 Kaidan Gustave

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Package Sidebar

Install

npm i kotlin-react-helmet

Weekly Downloads

0

Version

1.2.0

License

Apache-2.0

Unpacked Size

28.4 kB

Total Files

8

Last publish

Collaborators

  • kaidangustave