Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ssr cssinjs instance #32

Merged
merged 3 commits into from
Jul 1, 2022
Merged

fix: ssr cssinjs instance #32

merged 3 commits into from
Jul 1, 2022

Conversation

MadCcc
Copy link
Member

@MadCcc MadCcc commented Jul 1, 2022

No description provided.

@github-actions
Copy link

github-actions bot commented Jul 1, 2022

🎊 PR Preview e031c08 has been successfully built and deployed to https://ant-design-cssinjs-preview-pr-32.surge.sh

🕐 Build time: 201.796s

🤖 By surge-preview

@codecov-commenter
Copy link

Codecov Report

Merging #32 (42c307f) into master (27fbf5b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #32   +/-   ##
=======================================
  Coverage   98.78%   98.79%           
=======================================
  Files           8        8           
  Lines         329      331    +2     
  Branches      107      108    +1     
=======================================
+ Hits          325      327    +2     
  Misses          4        4           
Impacted Files Coverage Δ
src/StyleContext.tsx 96.77% <100.00%> (+0.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27fbf5b...42c307f. Read the comment docs.

Comment on lines 17 to 19
if (!(style as any)[CSS_IN_JS_INSTANCE]) {
(style as any)[CSS_IN_JS_INSTANCE] = CSS_IN_JS_INSTANCE_ID;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (!(style as any)[CSS_IN_JS_INSTANCE]) {
(style as any)[CSS_IN_JS_INSTANCE] = CSS_IN_JS_INSTANCE_ID;
}
(style as any)[CSS_IN_JS_INSTANCE] ||= CSS_IN_JS_INSTANCE_ID;

看看是不是能用这个,或者 ??=

Copy link
Member Author

Choose a reason for hiding this comment

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

学到了

@MadCcc MadCcc merged commit acdd633 into master Jul 1, 2022
@MadCcc MadCcc deleted the fix/ssr-cssinjs-instance branch July 1, 2022 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants