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

How can I close the loader within the component? #3

Open
willemevenwel opened this issue May 3, 2021 · 4 comments
Open

How can I close the loader within the component? #3

willemevenwel opened this issue May 3, 2021 · 4 comments

Comments

@willemevenwel
Copy link

Hi,

I have included your library as suggestion in code as a component. I would like the loader to close itself after a certain amount of time has passed. The loader shows because of the property assigned to this.props.loading, however, I can not set that property after a delay, because of the inaccessibility of props.

Your guidance would be appreciated.

Regards,

Willem

@shamin
Copy link
Owner

shamin commented May 3, 2021

Hi @willemevenwel ,

Here is a codesandbox example https://codesandbox.io/s/old-tree-tdif9?file=/src/App.js for showing loader for a certain amount of time. I have used a loading state variable and set the loading to false after 3 seconds. Happy to help if you need more.

@willemevenwel
Copy link
Author

Bro, you are an absolute star!! Thanks so much.

@willemevenwel
Copy link
Author

In essence I completely understand. But I want to implement this on the Loading component, not on the parent component using the Loading component.

@shamin
Copy link
Owner

shamin commented May 3, 2021

This is a very simple library and I wanted to keep it simple so that it is easily customisable. You can easily copy paste the lib/loading.js and lib/style.css to your react project and customise it.

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