File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 77
88an 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
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
You can’t perform that action at this time.
0 commit comments