How to change from class component to functional component in ts file?

Viewed 21

I am working in micro front end code in that I need to change the class component to functional component but as it has oops in it. I don't found any ideas. May I know any leads and how to proceed ?

export interface ContainerOptions {
  name: string;
  routes: RouteDefinition[];
  layout: string;
  rootManifests?: RootManifest[];
  contentArea?: string;
  basePath?: string;
  services?: any;
}

export class MicroFrontendContainer {
  private name: string;
  private basePath: string;
  private options: ContainerOptions;
  private pluginRegistry: { [name: string]: ContainerPlugin } = {};
  private routes: RouteDefinition[];
  private services: any = {};

  constructor(opts: ContainerOptions) {
    this.options = opts;
    this.name = this.options.name;
    this.routes = this.options?.routes || [];
    this.basePath = this.options?.basePath || '';
    this.services = this.options?.services;

    this.registerPlugins([DebugPlugin]);
  }

 
} 
0 Answers
Related