Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"coverage": "npm test -- --coverage",
"lint": "eslint src/ --ext .tsx,.ts & eslint tests/ --ext .tsx,.ts",
"prepare": "husky install",
"prepublishOnly": "npm run compile && np --yolo --no-publish",
"prepublishOnly": "npm run compile && rc-np",
"start": "dumi dev",
"test": "rc-test"
},
Expand All @@ -42,6 +42,7 @@
},
"devDependencies": {
"@rc-component/father-plugin": "^2.0.1",
"@rc-component/np": "^1.0.3",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prepublishOnly 里要把 np 改成 rc-np,然后去掉参数

"@testing-library/react": "^16.0.0",
"@types/jest": "^29.4.0",
"@types/node": "^22.5.5",
Expand All @@ -60,7 +61,6 @@
"glob": "^9.2.1",
"husky": "^9.1.6",
"lint-staged": "^15.1.0",
"np": "^10.0.2",
"prettier": "^3.3.2",
"rc-test": "^7.0.14",
"react": "^18.0.0",
Expand Down
8 changes: 4 additions & 4 deletions src/Dom/dynamicCSS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ export function injectCSS(css: string, option: Options = {}) {
}

function findExistNode(key: string, option: Options = {}) {
const container = getContainer(option);
let { styles } = option;

styles ||= findStyles(getContainer(option));

return (option.styles || findStyles(container)).find(
node => node.getAttribute(getMark(option)) === key,
);
return styles.find(node => node.getAttribute(getMark(option)) === key);
}

export function removeCSS(key: string, option: Options = {}) {
Expand Down
Loading