🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

tenhigh-ecommerce-ui

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tenhigh-ecommerce-ui

template for react component

latest
npmnpm
Version
0.0.32
Version published
Maintainers
1
Created
Source

注意事项

  • 组件引入 mui 不能用引入指定组件的方式,必须从 '@mui/material' 引入
// 这样引入打包后在其他项目引入,会报错 React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

import Button from '@mui/material/Button';


// 这样引入就不会报错
import {Button} from '@mui/material';

  • tailwind css 需要把 src 下的 globals.css 编译到 .storybook 目录下之后,在 preview.ts 中引用

https://tailwindcss.com/docs/installation

// 编译
npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch
  • 组件导出用 export,不要用 default export,会导致在其他项目引入报错类型问题,例如组件 Dialog
// 使用 export
// export const Dialog = ...

// 不使用 export default
// const Dialog = ...
// export default Dialog

FAQs

Package last updated on 13 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts