profile page update synchronously.

making this chage to fetch all the data that need to be present
for the page on initial loading
This commit is contained in:
Nuwan 2024-03-11 07:27:00 +05:30
parent 8f84e5d12d
commit eb488e374b
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import React, { useRef, useEffect, useState, useReducer } from 'react';
import React, { useRef, useEffect, useLayoutEffect, useState, useReducer } from 'react';
import { Card, CardBody, Col, Row, CardHeader, Form, FormGroup, Label, Input, Button } from 'reactstrap';
import Select from 'react-select';
import FalconCardHeader from '../common/FalconCardHeader';
@ -60,7 +60,7 @@ function JKEditProfile() {
}
});
useEffect(() => {
useLayoutEffect(() => {
if (currentUser && !currentUserLoaded) {
setCurrentUserLoaded(true);
fetchCurentUser().then(data => {