Socket
Socket
Sign inDemoInstall

react-script-tag

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-script-tag

A react <script> tag that supports universal rendering


Version published
Weekly downloads
6.2K
increased by18.19%
Maintainers
1
Weekly downloads
 
Created
Source

react-script-tag

Greenkeeper badge npm npm CircleCI branch Code Climate Code Climate Conventional Commits

Features:
  • A React <script> tag that supports universal rendering
  • Client rendering correctly appends the script tag to the page
  • Supports client hydrate()
  • Works with react dev-tools
  • Supports onLoad and onError callbacks

If you've found this page, you may want to consider using react-html-metadata. It should simplify your use of metadata in React web applications.

Install

NPM
npm install --save react-script-tag
Yarn
yarn add react-script-tag

Example

import React, { Component } from 'react';
import ScriptTag from 'react-script-tag';

class Demo extends Component {

    render() {
        return (<ScriptTag isHydrating={true} type="text/javascript" src="some_script.js" />);
    }
}

API

All standard <script> attributes should be supported, including onLoad and onError callbacks.

isHydrating: boolean Must be true if the client is hydrate()ing the server render, otherwise false. Defaults to false.

Contribute

For questions or issues, please open an issue, and you're welcome to submit a PR for bug fixes and feature requests.

Before submitting a PR, ensure you run npm test to verify that your coe adheres to the configured lint rules and passes all tests. Be sure to include unit tests for any code changes or additions.

License

MIT

Keywords

FAQs

Package last updated on 04 Feb 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc