Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
edongashi authored Jun 3, 2018
1 parent 6202d2d commit 3752c46
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,19 @@ const MyUniversalComponent = universal(import('./MyComponent'))
// call this only after you're sure it has loaded
MyUniversalComponent.doSomething()
// If you are not sure if the component has loaded or rendered, call preloadWeak().
// This will attempt to hoist and return the inner component,
// but only if it can be loaded synchronously, otherwise null will be returned.
const InnerComponent = MyUniversalComponent.preloadWeak()
if (InnerComponent) {
InnerComponent.doSomething()
}
```
> NOTE: for imports using dynamic expressions, conflicting methods will be overwritten by the current component

> NOTE: preloadWeak() will not cause network requests, which means that if the component has not loaded, it will return null. Use it only when you need to retrieve and hoist the wrapped component before rendering. Calling preloadWeak() on your server will ensure that all statics are hoisted properly.

## Props API

- `isLoading: boolean`
Expand Down

0 comments on commit 3752c46

Please sign in to comment.