I am facing an issue with rendering the component level when it loads. After clicking on edit and calling the edit function, the data is properly loaded in console and all objects are shown. However, they do not render on the page level.
Below is the code snippet:
const handleEdit = async () => {
const { searchBrand } = await searchBrandAPI({ id });
searchBrand[0].translations.forEach(arrVal => {
console.log(arrVal, 'arrVal');
setDynamicValues([ ...dynamicValues, {
transLanguage: { label: arrVal.language, value: arrVal.languauge },
transName: arrVal.name,
transIsActive: { label: formatFirstCharUpperCase(arrVal.isActive, String), value: arrVal.isActive },
}]);
});
const strIsActive = { label: formatFirstCharUpperCase(searchBrand[0].isActive, String), value: searchBrand[0].isActive }
setValues({ name: searchBrand[0].name, isActive: strIsActive })
}