Skip to content

Commit 67fa77f

Browse files
committed
docs(README.md): add some clarifications and details [ci skip]
1 parent b8cee1f commit 67fa77f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77

88
an easier to use dynamic script loader with a [render prop](https://reactjs.org/docs/render-props.html)
99

10+
This is useful if you want to wait to load the Google Maps API until the user
11+
navigates to a view that uses it. When you mount a `<ScriptLoader>` component,
12+
it will create the script tag you've requested.
13+
14+
`<ScriptLoader>` doesn't load a given script URL more than once, even if there
15+
is a pre-existing `<script>` tag for that URL that it didn't create. If `src`
16+
prop changes, it will load that new URL.
17+
1018
## Version notes
1119

1220
* supports React 15 or 16
@@ -50,7 +58,7 @@ The package exports a single component with the following props:
5058

5159
### `src` (**required** `string`)
5260

53-
The script source.
61+
The script URL.
5462

5563
### `onLoad` (`?() => any`)
5664

@@ -63,8 +71,8 @@ script
6371

6472
### `children` (`?(state: State) => ?React.Node`)
6573

66-
The render function. It will be passed the following props, and may return
67-
the content to display:
74+
The render function. It will be called with an object having the following
75+
props, and may return your desired content to display:
6876

6977
* `loading` (`boolean`) - `true` iff the script is loading
7078
* `loaded` (`boolean`) - `true` iff the script successfully loaded

0 commit comments

Comments
 (0)