MCPcopy Index your code
hub / github.com/reactstrap/reactstrap / addDefaultProps

Function addDefaultProps

src/utils.js:385–403  ·  view source on GitHub ↗
(defaultProps, props)

Source from the content-addressed store, hash-verified

383];
384
385export function addDefaultProps(defaultProps, props) {
386 if (!defaultProps || !props) return props;
387
388 let result = { ...props };
389
390 Object.keys(defaultProps).forEach((key) => {
391 if (result[key] === undefined) {
392 result[key] = defaultProps[key];
393 }
394 if (
395 Object.keys(defaultProps[key] || {}).length > 0 &&
396 typeof defaultProps[key] === 'object'
397 ) {
398 addDefaultProps(defaultProps[key], result);
399 }
400 });
401
402 return result;
403}

Callers 2

Fade.jsFile · 0.90
TooltipFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…