New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@marshallku/react-postscribe

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@marshallku/react-postscribe

React component to render HTML with postscribe

latest
npmnpm
Version
0.2.0
Version published
Weekly downloads
71
-34.26%
Maintainers
1
Weekly downloads
 
Created
Source

@marshallku/react-postscribe

License NPM Version Known Vulnerabilities NPM Downloads

React component to render HTML with postscribe.

Inspired by react-postscribe.

What's the difference?
  • Add TypeScript support (both postscribe and react-postscribe)
  • Update version of React
  • Refactor to function component
  • Remove lodash

Made for better albamon mobile MSA

Install

npm install @marshallku/postscribe
# or
yarn add @marshallku/postscribe

Usage

import PostScribe from "@marshallku/react-postscribe";

function AdBanner() {
    return (
        <div className="ad-banner">
            <PostScribe html={`<script src="https://example.com/"></script>`} />
        </div>
    );
}

export default AdBanner;

Props

PropertyTyperequiredDescription
htmlstringtrueAn html string or a function that takes a DOM Document and writes to it.
afterAsync() => voidfalseA callback called when an async script has loaded
afterDequeue() => voidfalseA callback called immediately before removing from the write queue
afterStreamStart() => voidfalseA callback called sync after a stream's first thread release
afterWrite() => voidfalseA callback called after writing buffered document.write calls
done() => voidfalseA callback that will be called when writing is finished
autoFixbooleanfalseA boolean that allows disabling the autoFix feature of prescribe
beforeEnqueue() => voidfalseA callback called immediately before adding to the write queue
beforeWrite() => voidfalseA callback called before writing buffered document.write calls
beforeWriteToken() => voidfalseA callback called before writing a token
error() => voidfalseA function that throws the error by default, but could be overwritten
releaseAsyncbooleanfalseA boolean whether to let scripts w/ async attribute set fall out of the queue

Keywords

react

FAQs

Package last updated on 30 Apr 2024

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