@mingfuyun/star-allinone 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -263,6 +263,23 @@ HocModal会将你的组件包装,并注入以下props:
|
|
|
263
263
|
|
|
264
264
|
适用于需要动态控制显示/隐藏,并且需要传递参数的Modal场景。
|
|
265
265
|
|
|
266
|
+
#### ⚠️ 常见错误
|
|
267
|
+
|
|
268
|
+
**错误用法**:
|
|
269
|
+
```tsx
|
|
270
|
+
// ❌ 错误:HocModal 是一个高阶组件,不能直接作为组件使用
|
|
271
|
+
<HocModal />
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**正确用法**:
|
|
275
|
+
```tsx
|
|
276
|
+
// ✅ 正确:先使用 HocModal 包装你的组件
|
|
277
|
+
const WrappedModal = HocModal(MyContent);
|
|
278
|
+
<WrappedModal ref={modalRef} />
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**注意**:`HocModal` 是一个函数,接受一个组件作为参数,返回一个新的包装组件。不能直接作为 React 组件使用。
|
|
282
|
+
|
|
266
283
|
### CustomDrawer 自定义抽屉
|
|
267
284
|
|
|
268
285
|
基于Antd Drawer的增强组件,提供统一的样式和默认配置,支持自定义底部操作栏。
|