BuilderIO/mitosis

HTML export does not support getters

Open

#232 ouverte le 21 mars 2022

Voir sur GitHub
 (2 commentaires) (0 réactions) (0 assignés)TypeScript (411 forks)batch import
bughelp wanted

Métriques du dépôt

Stars
 (9 803 stars)
Métriques de merge PR
 (Merge moyen 1j 1h) (6 PRs mergées en 30 j)

Description

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.

Guide contributeur