-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Login Background Image: handle empty ref
Even though the React doc ensure the ref creation is done before the componentDidMount, it can happen that the ref is set to null until the next render. So, to handle this case the component will now try to load the image on the componentDidMount, but if the ref doesn't exist, it will try again on the following componentDidUpdate. The try will be done only once. Refs: - https://reactjs.org/docs/refs-and-the-dom.html
- Loading branch information
Showing
1 changed file
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters