useMergedConfig.js 323 B

1234567
  1. import * as React from 'react';
  2. export default function useMergedConfig(propConfig, templateConfig) {
  3. return React.useMemo(() => {
  4. const support = !!propConfig;
  5. return [support, Object.assign(Object.assign({}, templateConfig), support && typeof propConfig === 'object' ? propConfig : null)];
  6. }, [propConfig]);
  7. }