-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Button): 修復 breakpoints.map is not a function 問題
原因出在 styled-system@^5.1.4 底下的 @styled-system/css/dist/index.esm.js 第 115 與 116 行: ```js var breakpoints = get(theme, 'breakpoints', defaultBreakpoints); var mediaQueries = [null].concat(breakpoints.map(function (n) { ``` 這裡的 `theme.breakpoints` default 本來應該是 array,但因為 2B 剛好也有 `theme.breakpoints`,而且類型是 object,加上 theme override [1] 機制在 [email protected] 又壞掉! 所以兩個問題加起來,導致 `breakpoints.map is not a function`。 解決方法: 1. 避免 Button 的 theme 被 override [1] 2. 升級 [email protected] 修復 theme override bug [2][3] - [1] https://styled-components.com/docs/advanced#the-theme-prop - [2] styled-components/styled-components#294 - [3] styled-components/styled-components@14c1c29 Ref hahow/hahow-for-business#724
- Loading branch information
Showing
3 changed files
with
46 additions
and
69 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters