Brandon Presley
49b5eb48c6
Instead of using a context for the whole app use DeviceEventEmitter with root state. This will probably improve performance, since I think the react context was re-rendering the entire DOM tree.
8 lines
162 B
TypeScript
8 lines
162 B
TypeScript
import {DeviceEventEmitter} from 'react-native'
|
|
|
|
export const TOAST = 'toast'
|
|
|
|
export function toast(value: string) {
|
|
DeviceEventEmitter.emit(TOAST, {value})
|
|
}
|