babel-plugin-transform-react-to-vue icon indicating copy to clipboard operation
babel-plugin-transform-react-to-vue copied to clipboard

[Help] "extends React.PureComponent"

Open ebellumat opened this issue 6 years ago • 0 comments

I own some classes written this way:

class PivotTable extends React.PureComponent {
  render() {
    const Renderer = this.props.renderers[
      this.props.rendererName in this.props.renderers
        ? this.props.rendererName
        : Object.keys(this.props.renderers)[0]
    ];
    return <Renderer {...this.props} />;
  }
}

But, the output, I do not think it's appropriate conversion to Vue.

class PivotTable extends React.PureComponent {
  render() {
    const Renderer = this.props.renderers[this.props.rendererName in this.props.renderers ? this.props.rendererName : Object.keys(this.props.renderers)[0]];
    return <Renderer {...this.props} />;
  }

}

What would be the correct equivalent conversion? Is this in the plans to enter Lib?

ebellumat avatar Aug 19 '18 01:08 ebellumat