Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-stencil-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-stencil-wrapper

React Stencil Wrapper

  • 0.0.8
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Stencil Wrapper

This module enables you to easily wrap Stencil components in React apps, taking full advantage of life cycle hooks so events are added and removed whenever a React component is mounted and unmounted.

Example usage where 'st-button' is a Stencil component:

import { StencilComponentWrapper } from './react-stencil-wrapper';

class App extends React.Component {
  constructor() {
    super();
    this.state = {
      name: 'Jag'
    };
  }

  handleClick = message => {
    console.log(message);
  };

  handleEvent = e => {
    console.log('handled event', e);
  };

  render() {
    return (
        <StencilComponentWrapper
        name={this.state.name}
        clickEvent={this.handleClick}
        eventListeners={{
            buttonClicked: this.handleEvent
        }}
        componentDidMountCallback={el => {
            el.focus();
        }}
        >
        <st-button>Click Me</st-button>
        </StencilComponentWrapper>;
    )
  }
}

FAQs

Package last updated on 13 Jun 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