Comments (6)
Hey-
What version of react are you using? Also- if you remove the Preload component from your component class, does the issue disappear?
from react-preload.
Hey Sam
Good point, I updated React to 0.14.0 and fixed some dependencies and don't have any exceptions now. Is this the version of React you recommend?
thanks
Will
from react-preload.
UPDATE :
In your example did you just drop a react component in here?
{/* content to be rendered once loading is complete*/}
My render function looks like the below and I get this exception now Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).
render: function() {
var loadingIndicator = (<div>Loading...</div>)
var images = ["images/brazil1.jpg","images/brazil2.jpg"];
return (
<Preload
loadingIndicator={loadingIndicator}
images={images}
autoResolveDelay={3000}
onError={this._handleImageLoadError}
onSuccess={this._handleImageLoadSuccess}
resolveOnError={true}
mountChildren={true}
>
{
/* content to be rendered once loading is complete*/
<Container />
}
</Preload>
)
}
Thanks for all the help
Will
from react-preload.
Will-
React 0.13 or up is definitely recommended.
The content can be any valid react Component. The error you are getting is because you have it wrapped in the {}
braces and left the comment in - leave just your container and you should be good.
from react-preload.
Hey Sam
Sorry to bug you on the wk, but just trying to debug how you got this setup. Here is a screen shot from dev tools showing the var Preload being returned as undefined
and I get the same error message as below, it seems Preload is not being recognized as a React Class. Is this possibly because I am not using ES6 rather just doing it with jsx?
Thanks
Will
Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).
from react-preload.
Hey Sam
Sorry to bother you again but last try with the module here.
I tried with a blank repo with just react and a very simple test class with nothing complicated about it so I could see what is going on and still I get the same error as above, I put it in the below repo. Is there anything else I am missing because it seems like there is a big step that I am completely missing out on as right now it isn't getting any where at all.
https://github.com/vancouverwill/preloadReactTest0.13.0
for what it's worth I did try with 0.14 but no luck there either
https://github.com/vancouverwill/preloadReactTest0.14.0
thanks
Will
from react-preload.
Related Issues (20)
- Warning on route change HOT 1
- Compatibility with ReactCSSTransitionGroup HOT 2
- images not preloading on receiving new props HOT 5
- ImageHelper.js?5691:18Uncaught TypeError: Promise is not a constructor
- Image flashes after component mounts HOT 2
- crossorigin breaks cache when using it without it HOT 1
- Images failed to preload HOT 9
- Feature to know % of files loaded HOT 1
- Use the prop-types package instead of React.PropTypes HOT 2
- Preload images with hashes
- Using a fake image throws an error in the console but onError is not called HOT 1
- Using proptypes from its own library HOT 1
- [deleted]
- TypeError: Cannot read property 'element' of undefined HOT 7
- Keep loadingIndicator on error?
- Failed to minify ImageHelper.js HOT 4
- Cannot import preload HOT 2
- Cannot load react-preload in older browsers such as Internet Explorer 11
- Package failed after upgrading React to 16.x HOT 1
- Make loadingIndicator prop optional HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-preload.