next-app-template icon indicating copy to clipboard operation
next-app-template copied to clipboard

Error during build

Open SayanDasDev opened this issue 1 year ago • 3 comments

image

SayanDasDev avatar Feb 06 '24 04:02 SayanDasDev

I have the same Issue.

nirual81 avatar Feb 08 '24 16:02 nirual81

same here

JohnnyTheTank avatar Feb 13 '24 22:02 JohnnyTheTank

Using createElement solves this.

Replace this:

return (
		<Component
			{...getBaseProps({
				className: clsx(
					"px-px transition-opacity hover:opacity-80 cursor-pointer",
					className,
					classNames?.base
				),
			})}
		>
			<VisuallyHidden>
				<input {...getInputProps()} />
			</VisuallyHidden>
			<div
				{...getWrapperProps()}
				className={slots.wrapper({
					class: clsx(
						[
							"w-auto h-auto",
							"bg-transparent",
							"rounded-lg",
							"flex items-center justify-center",
							"group-data-[selected=true]:bg-transparent",
							"!text-default-500",
							"pt-px",
							"px-0",
							"mx-0",
						],
						classNames?.wrapper
					),
				})}
			>
			 {!isSelected || isSSR ? <SunFilledIcon size={22} /> : <MoonFilledIcon size={22} />}
			</div>
		</Component>
	);

With this:

return createElement(Component, getBaseProps({
        className: clsx(
            "px-px transition-opacity hover:opacity-80 cursor-pointer",
            className,
            classNames?.base
        ),
    }),
        <>
            <VisuallyHidden>
                <input {...getInputProps()} />
            </VisuallyHidden>
            <div
                {...getWrapperProps()}
                className={slots.wrapper({
                    class: clsx(
                        [
                            "w-auto h-auto",
                            "bg-transparent",
                            "rounded-lg",
                            "flex items-center justify-center",
                            "group-data-[selected=true]:bg-transparent",
                            "!text-default-500",
                            "pt-px",
                            "px-0",
                            "mx-0",
                        ],
                        classNames?.wrapper
                    ),
                })}
            >
                {!isSelected || isSSR ? <SunFilledIcon size={22} /> : <MoonFilledIcon size={22} />}
            </div>
        </>
    );

And of course import:

import { FC, createElement } from "react";

gromoglasov avatar Feb 23 '24 11:02 gromoglasov

Closing - no longer applicable

image

wingkwong avatar May 21 '24 08:05 wingkwong