Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does toast.isActive() only take effect when placement is set to bottom #5790

Open
1 of 5 tasks
binrege opened this issue Oct 20, 2023 · 0 comments
Open
1 of 5 tasks

Comments

@binrege
Copy link

binrege commented Oct 20, 2023

Description

set placement to top is not usefull

CodeSandbox/Snack link

no link

Steps to reproduce

image
{"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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant