Skip to content

Add React.render to your component automatically (used in reactview)

Notifications You must be signed in to change notification settings

zackify/render-placement-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

##React Render Placement Loader

npm install render-placement-loader

This will add React.render(React.createElement(Component),document.body) to your jsx for you. It will also replace React.render(class,document.getElementById('blah')) with document.body if it exists.

You can also pass an optional props object via the query.

Usage:

component: explicitly pass the name of the component you want rendered props: props to pass the component replace: true or false if React.render is found , it will be replaced by default

{
    test: /\.jsx$/,
    loader: 'render-placement-loader',
    query: { 
    	props: { foo: 'bar' },
    	component: 'ComponentName'
    }
}

Works with ES6 classes and React.createClass components.

About

Add React.render to your component automatically (used in reactview)

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •