Skip to content

Instantly share code, notes, and snippets.

@MarekZeman91
Created April 17, 2022 23:59
Show Gist options
  • Save MarekZeman91/e2b7210bcbb67a7e5b4b398124b242a7 to your computer and use it in GitHub Desktop.
Save MarekZeman91/e2b7210bcbb67a7e5b4b398124b242a7 to your computer and use it in GitHub Desktop.
import { useRef } from 'react';
export function useScope<T>(values: T): T {
return Object.assign(useRef({} as T).current, values);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment