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

react-render-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-render-wrapper

Simple wrapper to React.render

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

react-render-wrapper

A easy to use factory wrapper for react components. If you don't use jsx then

//instead of having something like below
var pager2 = React.render(
       React.createElement(ViewPager.cls,{ 
           views : ["page11","page22","page33"], visible:"page11"}),
   document.getElementById("viewpager-container2"));

//you can expose your component to something liek below instead
var MyReactClss = require("./myreact-cls"); //React.createClass({});

MyReactClss.render({ options },"documentId" || htmlElementInstance);
MyReactClss.cls; //the actual class
MyReactClss.el({options}); //React.createElement(options) wrapper

Usage

$ npm install react-render-wrapper

var renderWrapper= require('react-render-wrapper');
module.exports = renderWrapper(React,MyReactClass);

//and clients can do
MyReactClass = require('react-myclass');

MyReactClass.render({option:'myoption'},'elementid'); //option and element id
MyReactClass.render('elementid'); //render directly with default options
MyReactClass.render($container.find('.cls-cont').get(0)); //render directly with default options
MyReactClass.el({}); //pass options for React.createElement short cut

//if you use jsx
React.render(<MyReactClass.cls/>,el);

FAQs

Package last updated on 11 Jan 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