((props, ref) => {
+ const itemProps = React.useContext(YForm.YFormItemContext);
+ const { items } = itemProps as YFormCardProps;
+
+ React.useImperativeHandle(ref, () => props);
+
+ return (
+
+ {items}
+
+ );
+});
From 06b2a4250f8e0b2940e5835ab5c44f81a79b69fb Mon Sep 17 00:00:00 2001
From: crazyair <645381995@qq.com>
Date: Tue, 25 Aug 2020 15:38:02 +0800
Subject: [PATCH 5/5] feat: upgrade package
---
package.json | 34 +++++++++----------
packages/yforms/package.json | 8 ++---
.../__snapshots__/YFormItems.test.tsx.snap | 9 +++++
3 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/package.json b/package.json
index 3df3cd9..7c6dd47 100644
--- a/package.json
+++ b/package.json
@@ -39,55 +39,55 @@
"devDependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
"@babel/polyfill": "^7.10.4",
- "@commitlint/cli": "^9.1.1",
- "@commitlint/config-conventional": "^9.1.1",
- "@testing-library/react": "^10.4.8",
+ "@commitlint/cli": "^9.1.2",
+ "@commitlint/config-conventional": "^9.1.2",
+ "@testing-library/react": "^10.4.9",
"@testing-library/react-hooks": "^3.4.1",
"@types/classnames": "^2.2.10",
"@types/enzyme": "^3.10.5",
- "@types/jest": "^26.0.9",
- "@types/lodash": "^4.14.159",
- "@types/react": "^16.9.44",
+ "@types/jest": "^26.0.10",
+ "@types/lodash": "^4.14.160",
+ "@types/react": "^16.9.47",
"@types/react-dom": "^16.9.8",
"@types/react-router-dom": "^5.1.5",
"@types/react-test-renderer": "^16.9.3",
"@types/warning": "^3.0.0",
"@umijs/fabric": "^2.2.2",
- "@umijs/test": "^3.2.14",
+ "@umijs/test": "^3.2.16",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.0",
- "conventional-changelog": "^3.1.21",
+ "conventional-changelog": "^3.1.23",
"cross-env": "^7.0.2",
"dumi": "^1.0.34",
"enzyme": "^3.11.0",
- "enzyme-adapter-react-16": "^1.15.2",
- "eslint": "7.6",
+ "enzyme-adapter-react-16": "^1.15.3",
+ "eslint": "7.7",
"eslint-config-umi": "^1.6.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^23.20.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
- "eslint-plugin-react": "^7.20.5",
- "eslint-plugin-react-hooks": "^4.0.8",
+ "eslint-plugin-react": "^7.20.6",
+ "eslint-plugin-react-hooks": "^4.1.0",
"eslint-plugin-unicorn": "^21.0.0",
"father-build": "^1.18.2",
"husky": "^4.2.5",
"lerna": "^3.22.1",
"lerna-changelog": "^1.0.1",
"lint-staged": "^10.2.11",
- "prettier": "^2.0.5",
- "rc-util": "^5.0.6",
+ "prettier": "^2.1.0",
+ "rc-util": "^5.0.7",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"react-test-renderer": "^16.13.1",
- "typescript": "^3.9.7",
- "umi": "^3.2.14"
+ "typescript": "^4.0.2",
+ "umi": "^3.2.16"
},
"license": "MIT",
"dependencies": {
- "antd": "^4.5.2",
+ "antd": "^4.6.1",
"immutable": "^4.0.0-rc.12",
"rc-queue-anim": "^1.8.5"
}
diff --git a/packages/yforms/package.json b/packages/yforms/package.json
index d0c59bb..1a71912 100644
--- a/packages/yforms/package.json
+++ b/packages/yforms/package.json
@@ -29,10 +29,10 @@
"registry": "https://registry.npmjs.org/"
},
"dependencies": {
- "@ant-design/icons": "^4.2.1",
- "@babel/runtime": "^7.10.5",
- "antd": "^4.5.0",
- "lodash": "^4.17.19",
+ "@ant-design/icons": "^4.2.2",
+ "@babel/runtime": "^7.11.2",
+ "antd": "^4.6.1",
+ "lodash": "^4.17.20",
"moment": "^2.27.0",
"numbro": "^2.3.1",
"nzh": "^1.0.4",
diff --git a/packages/yforms/src/YForm/__test__/__snapshots__/YFormItems.test.tsx.snap b/packages/yforms/src/YForm/__test__/__snapshots__/YFormItems.test.tsx.snap
index 39cf962..d4340f6 100644
--- a/packages/yforms/src/YForm/__test__/__snapshots__/YFormItems.test.tsx.snap
+++ b/packages/yforms/src/YForm/__test__/__snapshots__/YFormItems.test.tsx.snap
@@ -1408,6 +1408,9 @@ Object {
+
@@ -3754,6 +3757,9 @@ Object {
+
@@ -5159,6 +5165,9 @@ Object {
+