BuilderIO/mitosis

HTML export does not support getters

Open

#232 opened on 2022年3月21日

GitHub で見る
 (2 comments) (0 reactions) (0 assignees)TypeScript (411 forks)batch import
bughelp wanted

Repository metrics

Stars
 (9,803 stars)
PR merge metrics
 (平均マージ 1d 1h) (30d で 6 merged PRs)

説明

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.

コントリビューターガイド