Socket
Book a DemoInstallSign in
Socket

react-hoisted-state

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hoisted-state

nest meta-data inside your react-tree and get notified on state change

latest
Source
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

#React-Hoisted-State

Embed and extract State from The React Tree

#Examples


var keywords= [];

function visit(obj,event){
  switch(event){
    case 'mount':
    case 'unmount' :
    case 'render' :
      //`this` is the component, do sth. with it...
    break;
  }

  if(obj.keywords) keywords = keywords.concat(keywords);

}

const Title = ({children})=>(
<State title={children.toString()}/><h2>
  {children.toString()}
</h2></State>
);


const body = React.renderToString(
  <Hoist visit={getKeywords} />
    <article>
      <Title>How to Hoist State</Title>
      foo
    </article>

    <article>
      <Title>some other article </Title>
      bar
    </article>
  </Hoist>
);

const html = `
<html>
<head>
<title>titles.join(' - ')</title>
</head>
<body>${body}</body>
</html>
`

Keywords

meta

FAQs

Package last updated on 18 Sep 2015

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.