MCPcopy Index your code
hub / github.com/reactjs/react-codemod / createDefaultProps

Function createDefaultProps

transforms/class.js:380–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378 };
379
380 const createDefaultProps = prop =>
381 withComments(
382 j.property(
383 'init',
384 j.identifier(DEFAULT_PROPS_KEY),
385 pickReturnValueOrCreateIIFE(prop.value)
386 ),
387 prop
388 );
389
390 // Collects `childContextTypes`, `contextTypes`, `displayName`, and `propTypes`;
391 // simplifies `getDefaultProps` or converts it to an IIFE;

Callers 1

collectStaticsFunction · 0.85

Calls 2

withCommentsFunction · 0.70

Tested by

no test coverage detected