react-native-unicorn-modals icon indicating copy to clipboard operation
react-native-unicorn-modals copied to clipboard

Provide a guide, how to show modal outside React components (e.g. inside redux middleware)

Open bezenson opened this issue 2 years ago • 5 comments

bezenson avatar Dec 31 '22 10:12 bezenson

+1 same time , the HTTP response need to show alert same time , the socket received need to show alert

boboxiaodd avatar Feb 17 '23 08:02 boboxiaodd

@boboxiaodd For now you can handle it inside component. Just pass redux state into your component and handle it

bezenson avatar Feb 17 '23 08:02 bezenson

@inferusvv i don't know how to use redux, i use DeviceEventEmitter in my homeScreen to send and receive to show alert

boboxiaodd avatar Feb 17 '23 08:02 boboxiaodd

const modal = useModals(); global.modal = modal

Put the modal into the global variable so that it can be used in the task place

huanglong6828 avatar May 12 '23 10:05 huanglong6828

const modal = useModals(); global.modal = modal

Put the modal into the global variable so that it can be used in the task place

It will work, but it is anti-pattern, in my opinion :)

bezenson avatar May 12 '23 10:05 bezenson