N
N
Neuro2019-07-03 14:27:59
JavaScript
Neuro, 2019-07-03 14:27:59

React loading modal?

How can I implement a loading modal in react?
For example, I visit a page and send a request while the request is waiting for a response, the page shows a loading screen, and dims and blocks all functionality until a response arrives.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2019-07-03
@Riveran

How can I implement a loading modal in react?

Just like without React. For good, for modals you need to use the portal . A handy library for working with portals react-portal . If you want to block only a single block, then you do not need to use the portal. where isFetching is the loading state, Preloader is your overlay/modal window.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question