jsx-to-string icon indicating copy to clipboard operation
jsx-to-string copied to clipboard

Unneded dependencies

Open pfteter opened this issue 8 months ago • 0 comments

The code has some unneded external dependencies. We have to add whole react only for a oneliner:

/**
 * Verifies the object is a ReactElement.
 * See https://reactjs.org/docs/react-api.html#isvalidelement
 * @param {?object} object
 * @return {boolean} True if `object` is a ReactElement.
 * @final
 */
export function isValidElement(object) {
  return (
    typeof object === 'object' &&
    object !== null &&
    object.$$typeof === REACT_ELEMENT_TYPE
  );
}

see: https://github.com/grommet/jsx-to-string/blob/bd786a0393fee81df262bfb83b3945710a1327cf/src/index.js#L1

same goes proabably for immutable.js and json-stringify-pretty-compact

pfteter avatar Jun 17 '24 12:06 pfteter