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

Function convertInitialStateToClassProperty

transforms/class.js:552–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

550 };
551
552 const convertInitialStateToClassProperty = getInitialState =>
553 withComments(j.classProperty(
554 j.identifier('state'),
555 pickReturnValueOrCreateIIFE(getInitialState.value),
556 getInitialState.value.returnType,
557 false
558 ), getInitialState);
559
560 const createConstructorArgs = (hasContextAccess) => {
561 if (hasContextAccess) {

Callers 1

createESClassFunction · 0.85

Calls 2

withCommentsFunction · 0.70

Tested by

no test coverage detected