How do I add custom loading screen to react komposer?


#1

React komposer docs say that custom loading screen is added like this:

const MyLoading = () => (<div>Hmm…</div>);
const Container = compose(composerFunction, MyLoading)(Component);

But composeWithTracker() is used in Meteor instead of compose().

When use it in the example above like this:

const Container = composeWithTracker(composerFunction, MyLoading)(Component);

I get the following error on browser console:

Uncaught ReferenceError: React is not defined

How do I add custom loading screen to react komposer?


#2

did you found the solution


#3

If you’re using JSX you need to import react in that file. The MyLoading component is using JSX.

import react from 'react';