My understanding is that server components are not officially supported in the Next.js storybook beta for v7, but that there was a workaround for this. However, I'm a bit confused how that applies directly to stories.
I have a story that normally looks like this, where Component is a server component that is async:
import React from "react";
import { StoryFn, Meta } from "@storybook/react";
import Component from ".";
// type error here
export default {
title: "Component",
component: Component,
} as Meta<typeof Component>;
const Template: StoryFn<typeof Component> = (args) => (
// type error here
<Component {...args} />
);
export const Default = Template.bind({});
Default.args = {
// args go here
};
Essentially not compatible (obviously) because a Promise<Element> is not compatible with the typical ReactElement. Is there a current workaround for this?