Skip to content

feat: Ability to rename/format generated component names #122

Open
@isaaclem90

Description

@isaaclem90

I'm wondering if there is such option for us to add suffix when we create a React version of it?

For example, below is my stencil Component IonicButton, I'm wondering if it's possible to configure so that it spits a different component name?

import {Component, h, Prop} from '@stencil/core';

@Component({
  tag: 'ionic-button',
  shadow: false
})
export class IonicButton {
  /**
   * Button text
   */
  @Prop() text: string;

  render() {
    return <button class={'button button--primary'}>xxx</button>;
  }
}

generated index.ts

export const IonicButton = /*@__PURE__*/createReactComponent<JSX.IonicButton, HTMLIonicButtonElement>('ionic-button');

Instead of spitting IonicButton, I would like to have IonicButtonReact instead.

The actual problem I'm facing is because we have a single storybook that use stencil as source of truth, and we render React version on this single storybook, and we facing a name clashing issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featureNew feature, request or improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions