https://github.com/scriptollc/lazy-render
https://github.com/scriptollc/lazy-render
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/scriptollc/lazy-render
- Owner: scriptoLLC
- License: other
- Created: 2017-01-23T20:47:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-02-13T00:07:42.000Z (over 7 years ago)
- Last Synced: 2025-06-22T18:53:19.065Z (12 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lazy-render
A helper to render React components for lazy-router (or whatever)
## Usage
```js
const router = require('lazy-router')('/404')
const render = require('lazy-render')('#app')
const LazyComponent = require('./my-component')
router.on('/lazy-routing', (path, location) => render(LazyComponent, {location}))
```
## API
#### `render(mountPoint: selector) -> (Component: HTMLComponent, props: object): void`
`render` returns a function which will mount a given component in the DOM at the
location specified via the `mountPoint` selector, and additionally pass any
properties specified into the component.
## License
Copyright © 2017 Script LLC. Apache-2.0 licensed