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

Function mixinsFilter

transforms/class.js:1195–1210  ·  view source on GitHub ↗
(classPath)

Source from the content-addressed store, hash-verified

1193 // class mixins is an array and only contains the identifier -> true
1194 // otherwise -> false
1195 const mixinsFilter = (classPath) => {
1196 if (!ReactUtils.directlyHasMixinsField(classPath)) {
1197 return true;
1198 } else if (options['pure-component'] && pureRenderMixinPathAndBinding) {
1199 const {binding} = pureRenderMixinPathAndBinding;
1200 if (areMixinsConvertible([binding], classPath)) {
1201 return true;
1202 }
1203 }
1204 console.warn(
1205 file.path + ': `' + ReactUtils.directlyGetComponentName(classPath) + '` ' +
1206 'was skipped because of inconvertible mixins.'
1207 );
1208
1209 return false;
1210 };
1211
1212 const reinsertTopComments = () => {
1213 root.get().node.comments = topComments;

Callers 1

class.jsFile · 0.85

Calls 1

areMixinsConvertibleFunction · 0.85

Tested by

no test coverage detected