Open NunoCruzSW opened 2 weeks ago
I have Scenario with Translation Provider
So on one file
const TransContext = createContext<[TFunction, TransProviderActions]>(); export const useTransContext = () => useContext(TransContext); function createTransContext(){ // some code } export const TransProvider: ParentComponent<{ instance?: i18n, options?: InitOptions }> = (props) => { return <TransContext.Provider value={createTransContext(props.instance || i18next, props.options )} children={props.children} /> };
On import useTransContext other nested component it returns null;
export function Trans(prop: TransProps) { const [t] = useTransContext(); // this returns null return <>{t(prop.key, prop.options) }</> }
I have Scenario with Translation Provider
So on one file
On import useTransContext other nested component it returns null;