: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
import { createContext, useContext } from 'react';
} from '../constants/leadinConfig';
import { Message } from './messageMiddleware';
export const BackgroudAppContext = createContext<any>(null);
export function useBackgroundAppContext() {
return useContext(BackgroudAppContext);
export function usePostBackgroundMessage() {
const app = useBackgroundAppContext();
return (message: Message) => {
app.postMessage(message);
export function usePostAsyncBackgroundMessage(): (
const app = useBackgroundAppContext();
return (message: Message) => app.postAsyncMessage(message);