mitosis
mitosis copied to clipboard
Context loses imported file function after compiled
I am interested in helping provide a fix!
Yes
Which generators are impacted?
- [X] All
- [ ] Angular
- [ ] HTML
- [ ] Qwik
- [ ] React
- [ ] React-Native
- [ ] Solid
- [ ] Stencil
- [ ] Svelte
- [ ] Vue
- [ ] Web components
Reproduction case
fiddle not support multi files
Expected Behaviour
- utils/noop.ts
export default () => {}
- group.context.lite.ts
import { createContext } from '@builder.io/mitosis'
import noop from './shared/utils/noop'
export default createContext({
value: [],
check: noop,
})
- Vue group.context.ts
import noop from './shared/utils/noop'
const key = Symbol();
export default {
CheckboxGroup: { value: [], check: noop },
key,
};
- React group.context.ts
import { createContext } from "react";
import noop from './shared/utils/noop';
export default createContext({
value: [],
check: noop,
});
noop should be import.
Actual Behaviour
- Vue group.context.ts
const key = Symbol();
export default {
CheckboxGroup: { value: [], check: noop },
key,
};
- React group.context.ts
import { createContext } from "react";
export default createContext({
value: [],
check: noop,
});
noop is not defined !!
Additional Information
No response