-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[@mantine/core] <Title> renders <element> with vite build
#366
Comments
Hi @hauptrolle, here is our output esm code for Title component: const Title = forwardRef((_a, ref) => {
var _b = _a, { className, order = 1, children, align, style, sx } = _b, others = __objRest(_b, ["className", "order", "children", "align", "style", "sx"]);
if (![1, 2, 3, 4, 5, 6].includes(order)) {
return null;
}
const element = `h${order}`;
const { classes, cx } = useStyles({ element }, { sx, name: "Title" });
const styles = __spreadValues({}, style);
if (align) {
styles.textAlign = align;
}
const { mergedStyles, rest } = useExtractedMargins({ others, style: styles });
return React.createElement(element, __spreadValues({
className: cx(classes.root, className),
style: mergedStyles,
ref
}, rest), children);
}); It looks correct to me – we do not use element as a string here. I do not think that there is something that we can do on our side to fix it as it seems to be a bug in Vite bundler. |
I think this issue contains details – vitejs/vite#5441 |
Alright, I've released a patch that fixes this issue, update to 3.1.2 and Title will render correct element. |
Wow! Thank you so much for your fast response! |
Hello Guys,
first of all, thank your for this awesome library 👏
I have found an issue with the
<Title>
component from@mantine/core
when using it together withVite
.In the development mode everything works fine, but after building the app the
Title
components gets rendered as<element>
instead ofh1
. You can find an example repo hereThe text was updated successfully, but these errors were encountered: