How can I wrap javascript library, but only modify one of them?

Viewed 25

eg: i want to modify useRef

import * as React from 'react';

const {useRef, ...rest}
const myUseRef = function() {}

export {
  myUseRef as useRef,
  ...rest
}

i hope i can use it

import * as React from 'newReact';
const a = useRef(null);

how can i achieve it?

0 Answers
Related