小编use*_*526的帖子

Material-UI - 如何将自定义道具传递给自定义 TreeItem?

我需要将一个参数传递categoryCustomTreeItemis TreeItemContent
\n文档: https: //mui.com/ru/api/tree-item/

\n
import TreeItem, {\n  TreeItemProps,\n  useTreeItem,\n  TreeItemContentProps,\n} from \'@material-ui/lab/TreeItem\';\n\ninterface CatProps {\n  name: string,\n  id: string,\n}\n\ninterface CatItemContentProps extends TreeItemContentProps {\n  category: CatProps,\n}\n\nconst CustomContent = React.forwardRef(function CustomContent(\n    props: CatItemContentProps,\n    ref,\n  ) {\n    const { category } = props;\n    console.log(category); // undefined\n\n  return <></>;\n  }\n);\n\n\ninterface CatItemProps extends TreeItemProps {\n  category: CatProps,\n}\n\nconst CustomTreeItem = (props: CatItemProps) => {\n  return (\n    <TreeItem ContentComponent={CustomContent} {...props} />\n  );\n};\n\n
Run Code Online (Sandbox Code Playgroud)\n

我该怎么做?

\n

第一个答案后的\xd0\xa1说明

\n

新代码是:

\n
const CustomContent …
Run Code Online (Sandbox Code Playgroud)

typescript reactjs material-ui

3
推荐指数
1
解决办法
3723
查看次数

如何在nginx上部署react Remix框架进行生产?

我需要什么配置文件来启动 Remix 应用程序?\n它没有index.html文件

\n

重现步骤(https://remix.run/docs/en/v1/guides/deployment):

\n
npx create-remix@latest\n? Where would you like to create your app? (./my-remix-app)\n? Where do you want to deploy? Choose Remix if you\'re unsure, it\'s easy to change deployment targets. (Use arrow keys)\n\xe2\x9d\xaf Remix App Server\n? TypeScript or JavaScript? (Use arrow keys)\n\xe2\x9d\xaf TypeScript\ncd my-remix-app\nnpm run build\n
Run Code Online (Sandbox Code Playgroud)\n

我们必须目录:public, build

\n

下一步是什么来展示它的website.com使用nginx

\n

nginx reactjs remix.run

2
推荐指数
1
解决办法
5635
查看次数

标签 统计

reactjs ×2

material-ui ×1

nginx ×1

remix.run ×1

typescript ×1