BuilderIO/mitosis

HTML export does not support getters

Open

#232 geöffnet am 21. März 2022

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (9.803 Stars) (411 Forks)batch import
bughelp wanted

Beschreibung

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.

Contributor Guide