【发布时间】:2021-02-01 05:06:39
【问题描述】:
我所有的钩子都会导致 Invalid hook call 错误,这是在使用 npx sb init 安装故事书后发生的
import React from 'react'
import { useSectionsQuery } from "../../graphql/generated";
export const Home: React.FC = () => {
const { data } = useSectionsQuery();
return (
<div className="bg-gray-200">
<div style={{ backgroundColor: "#4267B2" }} className="grid grid-rows-1">
<div className="flex justify-center">
{data?.sectionMany.map((section: any) => {
return <Card {...section} />;
})}
</div>
</div>
</div>
)
}
【问题讨论】:
标签: reactjs react-hooks storybook