Skip to content

[Help] "extends React.PureComponent" #20

Open
@ebellumat

Description

@ebellumat

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions