Why does toast.isActive() only take effect when placement is set to bottom
binrege opened this issue · 0 comments
binrege commented
Description
set placement to top is not usefull
CodeSandbox/Snack link
no link
Steps to reproduce
{"bottom": [], "top": [{"component": <Memo … />, "config": [Object], "id": "498416516"}, {"component": <Memo … />, "config": [Object], "id": "498416516"}]}
const isActive = React.useCallback(
(id: any) => {
console.log(toastInfo);
for (const toastPosition of Object.keys(toastInfo)) {
const positionArray: Array = toastInfo[toastPosition];
console.log("positionArray",positionArray) // [],because "bottom": [], so toast.isActive()==>false
return positionArray.findIndex((toastData) => toastData.id === id) > -1;
}
return false;
},
[toastInfo]
);
NativeBase Version
3.4.25
Platform
- Android
- CRA
- Expo
- iOS
- Next
Other Platform
No response
Additional Information
No response