Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immediate enter #25

Open
peterbe opened this issue Jun 26, 2018 · 1 comment
Open

Immediate enter #25

peterbe opened this issue Jun 26, 2018 · 1 comment

Comments

@peterbe
Copy link

peterbe commented Jun 26, 2018

I use this component something like this:

class App extends React.Component {
  state = {loading: true}
  componentDidMount() {
    window.setTimeout(() => { this.setState({loading: false}, 3000);
  }
  render() {
    <Loadable
            active={this.state.loading}
            spinner
            background="rgba(256, 256, 256, 0.92)"
            color="#000"
            spinnerSize="140px"
            text="Loading the app..."
          >
      <Rest>
        <OfThe>
          <AppStuff/>
        </OfThe>
      </Rest>
    </Loadable>

  }
}

The only problem is that at the very very beginning you can see black text on white background for a couple hundred milliseconds, then it all fades out to white and the spinner appears. After about the page is loaded (see the 3,000ms timeout in componentDidMount the white overlay fades out and all is well.

What I would ideally like is for it to start immediately with the overlay on.

I think this could be achieved by not having a 500ms transitionEnterTimeout but I'm only speculating.

It's hard to take a screenshot at that first render, but here's what it looks like after about 1-2 seconds after loading the page:
screen shot 2018-06-26 at 8 48 02 am

@derrickpelletier
Copy link
Owner

Thanks, going to look into this. Just updated to v1.0.0 and changed the timeout functionality a bit but i'll verify whether this is still happening. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants