BuilderIO/mitosis

HTML export does not support getters

Aperta

#232 aperta il 21 mar 2022

 (2 commenti) (0 reazioni) (0 assegnatari)TypeScript (411 fork)batch import
bughelp wanted

Metriche repository

Star
 (9803 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Describe the bug Infinite loop when trying to use getter methods in useState and exporting to HTML

To Reproduce

import { useState } from '@builder.io/mitosis';
import { kebabCase } from 'lodash';

export default function SmileReviews(props) {
  const state = useState({
    get kebabCaseValue() {
      return kebabCase('testThat');
    },
  });

  return (
    <div data-user-kebab={state.kebabCaseValue}>
    </div>
  );
}

Expected behavior A clear and concise description of what you expected to happen.

Screenshots infinitely loops with the following error:

Additional context Add any other context about the problem here.

Guida contributor