contexts.RefContext.js Maven / Gradle / Ivy
import LambdaComponent from 'components/common/LambdaComponent';
import { createContext, useRef } from 'react';
export const CustomRefContext = createContext();
const CustomRefProvider = ({children}) => {
const ref = useRef()
const setCurrent = (value) => ref.current = value
const getCurrent = () => ref.current
return (
{children}
)
}
export default CustomRefProvider;