in my (freshly setup) local bit.dev environment, my component wont render under the preview tab section. The preview seems to work in the "Compositions" section in the preview tab.
Button Component Code
import type { ReactNode } from 'react';
export type ButtonProps = {
/**
* sets the component children.
*/
children?: ReactNode;
};
export function Button({ children }: ButtonProps) {
return (
<div>
{children}
</div>
);
}
Button Composition Code:
import { Button } from './button.js';
export const BasicButton = () => {
return (
<Button>hello world!</Button>
);
}
2
Answers
There is some problem with bitdev.react/[email protected]. Try to downgrade env for your component and it should work for now.
You can now upgrade to the latest
bitdev.react/react-env
and resolve the preview issue.bit envs set components/input/button bitdev.react/[email protected]
Also make sure that you are using
@teambit/react.mounter
v1.0.5
(in case you have it in your dependencies).