Open samijaber opened 2 years ago
Describe the bug Infinite loop when trying to use getter methods in useState and exporting to HTML
useState
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.
Most likely induced by this call: https://github.com/BuilderIO/mitosis/blob/fdebe412793fd9f1438282b9cc72e5782504fd66/packages/core/src/generators/html.ts#L351
https://github.com/BuilderIO/mitosis/blob/4f41a2c2fab004dc4ebf4866c70c2cbb89d0de3b/packages/core/src/helpers/babel-transform.ts#L55-L57
this is still an issue. I thought it was that bit of code too or maybe I was too tired.
Describe the bug Infinite loop when trying to use getter methods in
useState
and exporting to HTMLTo Reproduce
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.