https://github.com/zackify/render-placement-loader
Add React.render to your component automatically (used in reactview)
https://github.com/zackify/render-placement-loader
Last synced: 11 months ago
JSON representation
Add React.render to your component automatically (used in reactview)
- Host: GitHub
- URL: https://github.com/zackify/render-placement-loader
- Owner: zackify
- Created: 2015-05-13T05:01:55.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-19T06:30:36.000Z (almost 11 years ago)
- Last Synced: 2025-03-18T22:42:12.235Z (12 months ago)
- Language: JavaScript
- Size: 1.34 MB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
##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.