Spaces:
Sleeping
Sleeping
Download frontend/node_modules/@mui/utils/legacy/setRef/setRef.js from sepidnes/pythonic-rag-FastAPIReact: direct link, hf CLI and curl.
- Browser
- Download file 640 Bytes
-
https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/56fda741e84da791ee2e6198479f1d5630989f6c/frontend/node_modules/%40mui/utils/legacy/setRef/setRef.js
- Command line
-
hf download hf://spaces/sepidnes/pythonic-rag-FastAPIReact@56fda741e84da791ee2e6198479f1d5630989f6c/frontend/node_modules/@mui/utils/legacy/setRef/setRef.js
-
curl -L -o setRef.js https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/56fda741e84da791ee2e6198479f1d5630989f6c/frontend/node_modules/%40mui/utils/legacy/setRef/setRef.js
640 Bytes
| /** | |
| * TODO v5: consider making it private | |
| * | |
| * passes {value} to {ref} | |
| * | |
| * WARNING: Be sure to only call this inside a callback that is passed as a ref. | |
| * Otherwise, make sure to cleanup the previous {ref} if it changes. See | |
| * https://github.com/mui/material-ui/issues/13539 | |
| * | |
| * Useful if you want to expose the ref of an inner component to the public API | |
| * while still using it inside the component. | |
| * @param ref A ref callback or ref object. If anything falsy, this is a no-op. | |
| */ | |
| export default function setRef(ref, value) { | |
| if (typeof ref === 'function') { | |
| ref(value); | |
| } else if (ref) { | |
| ref.current = value; | |
| } | |
| } |