Git Product home page Git Product logo

Comments (6)

sambernard avatar sambernard commented on May 28, 2024

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.

vancouverwill avatar vancouverwill commented on May 28, 2024

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.

vancouverwill avatar vancouverwill commented on May 28, 2024

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.

sambernard avatar sambernard commented on May 28, 2024

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.

vancouverwill avatar vancouverwill commented on May 28, 2024

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

screen shot 2015-10-17 at 9 00 26 pm

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.

vancouverwill avatar vancouverwill commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.