@devgalena/react-use-logger
Version:
`react-use-logger` is a React hook to log messages. It also contains a function `useLogger` and a class `LoggingContextProvider` to set the logging levels of the library / application
26 lines (25 loc) • 458 B
JavaScript
import { jsx as m } from "react/jsx-runtime";
import { useState as n, useEffect as g } from "react";
import { LoggingContext as s } from "./LoggingContext.js";
const v = ({
level: o,
render: t,
children: e
}) => {
const [r, i] = n(o);
return g(() => {
i(o);
}, [o]), /* @__PURE__ */ m(
s.Provider,
{
value: {
level: r,
render: t
},
children: e
}
);
};
export {
v as LoggingContextProvider
};