Remove import-sideffect call to init()
Summary: Back out "Back out "[flipper] Export init function"" Original commit changeset: 93b916d472b7 The import side effect seems to cause some issues with shadowing, so let's pull this all the way to the top and call this from HTML as Sonar.init(). Reviewed By: danielbuechele Differential Revision: D9849869 fbshipit-source-id: b62772ecddc59eab00251ebf19816f470d76ba82
This commit is contained in:
committed by
Facebook Github Bot
parent
7dd4a83c9a
commit
175ba7f331
28
src/init.js
28
src/init.js
@@ -62,16 +62,18 @@ const AppFrame = () => (
|
||||
</TooltipProvider>
|
||||
);
|
||||
|
||||
// $FlowFixMe: this element exists!
|
||||
ReactDOM.render(<AppFrame />, document.getElementById('root'));
|
||||
// $FlowFixMe: service workers exist!
|
||||
navigator.serviceWorker
|
||||
.register(
|
||||
process.env.NODE_ENV === 'production'
|
||||
? path.join(__dirname, 'serviceWorker.js')
|
||||
: './serviceWorker.js',
|
||||
)
|
||||
.then(r => {
|
||||
(r.installing || r.active).postMessage({precachedIcons});
|
||||
})
|
||||
.catch(console.error);
|
||||
export default function init() {
|
||||
// $FlowFixMe: this element exists!
|
||||
ReactDOM.render(<AppFrame />, document.getElementById('root'));
|
||||
// $FlowFixMe: service workers exist!
|
||||
navigator.serviceWorker
|
||||
.register(
|
||||
process.env.NODE_ENV === 'production'
|
||||
? path.join(__dirname, 'serviceWorker.js')
|
||||
: './serviceWorker.js',
|
||||
)
|
||||
.then(r => {
|
||||
(r.installing || r.active).postMessage({precachedIcons});
|
||||
})
|
||||
.catch(console.error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user