[email protected]
์์ ์ฐ๋ฆฌ๊ฐ ์ํ๋ /ํด์ผ ํ ์ผ์ ๋
ผ์ ํ ์์๋ ์ฅ์ :
React @ 16 ์๋
ref: string
์์ ref: function
๋ฆฌํฉํฐ๋ง...
๊ฐ๋ฏธ ์์ ์
LocaleProvider
๋ณ๊ฒฝ๋์ด์ผ en
jsx
// We need to link moment before antd's dist file after [email protected]
<script src="moment.js"></script>
<script src="antd.js"></script>
๋๊ตฌ
...
Ant Design Specification ์๋
...
์ฌ์ดํธ ant.design
...
์ ๋ฐ์ดํธ๋์์ต๋๋ค.
์ ๋ฐ์ดํธ๋์์ต๋๋ค.
https://github.com/ant-design/ant-design/issues/5140 ์ ํธ์ง ๊ฐ๋ฅํ ํ๋ ์ด ๊ทธ๋ผ์ด๋๊ฐ ๋ ์ ์์ต๋๋ค.
๋์์ด๋์ ๊ณํ์ ๋ฐ๋ผ ๊ธฐ๋ณธ ๊ธ๊ผด ํฌ๊ธฐ๊ฐ ๋ ์ปค์ง ์ ์์ต๋๋ค.
cloneElement
์ context
๋ฆฌํฉํฐ๋ง?
์ฌ ๊ฐ์ค # 1473?
๋ ๊ฐ๋ ฅํ ๋ด์ฅ i18n ์ง์ https://github.com/ant-design/ant-design/issues/5554#issuecomment -290372828
๊ตฌ์ฑ ์์ TS ์ ์์ ์ฃผ์์ ๊ฐ์ ํ๊ณ ์๋ฒฝํ๊ฒ?
2-> 3 ๋๋ 1-> 3์ ๋๊ตฌ๋ ์ด๋ป์ต๋๊น?
@yesmeck https://github.com/ant-design/ant-design/issues/5570#issuecomment -290622803 ์๋ฏธ Tabs.TabPane[key]
๋ฐ Menu.Item[key]
ํฌ๊ธฐํด์ผ ํจ์ ์๋ฏธํฉ๋๋ค ...
๋ ๊ฐ๋ ฅํ ๋ด์ฅ i18n ์ง์ # 5554 (์ฝ๋ฉํธ)๋ฅผ ์ํฉ๋๋ค.
@plandem ํ๊ฐ ์ค์ ๋๋ค. ๊ทธ ๋ฌธ์ ์ ๋ํด ๊ณ์ ๋ ผ์ํฉ์๋ค.
๊ตฌ์ฑ ์์ TS ์ ์์ ์ฃผ์์ ๊ฐ์ ํ๊ณ ์๋ฒฝํ๊ฒ?
@infeng ์ด๊ฒ์ด TypeScript์์ ๋ฐ๋ชจ๋ฅผ ๋ค์ ์์ฑํ์ฌ ์ ์์์ ๋ฌธ์ ๋ฅผ ๋ฐ๊ฒฌ ํ ์์๋ ์ด์ ์ ๋๋ค https://github.com/ant-design/ant-design/issues/5390
2-> 3 ๋๋ 1-> 3์ ๋๊ตฌ๋ ์ด๋ป์ต๋๊น?
์, ์๋ฒฝํ ์๋ฃจ์ ์ ์๋์ง๋ง https://github.com/ant-design/ant-design/issues/3759#issuecomment -272353773๊ณผ ๊ฐ์ ๋๊ตฌ๋ฅผ ์ ๊ณตํด์ผํฉ๋๋ค.
@sorrycc webpack@2
๋ํด ์ด๋ป๊ฒ ์๊ฐํ์ธ์?
์์์๋ ํ ์คํธ ํธ์ง๊ธฐ์ ๋ํ ์ง์ ์ด ์์ต๋๊น? # 1083
ํธ์ง์๋ ํ์ฌ๋ก์๋ ์ต๊ทผ ๊ณํ์ ์์ ์ ์์ต๋๋ค.
ThemeProvider๋ https://github.com/ant-design/ant-design/issues/5656 ์์ ๋ ผ์ํด์ผํฉ๋๋ค.
ํ์ง๋ง [email protected]
์ ๋์
ํ ์๊ฐ์ด ์๋์ง ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.
์ฐจํธ์ ๋ํ ์๋ก์ด ๊ธฐ๋ฅ ์ถ๊ฐ
ํ์ด, ํ์ค ๊ทธ๋จ ๋ฑ๊ณผ ๊ฐ์.
์ฐจํธ์ ๋ํ ์๋ก์ด ๊ธฐ๋ฅ ์ถ๊ฐ
๋๋ ๊ทธ๊ฒ์ ๋ฐ๋ํฉ๋๋ค. ๋ค๋ฅธ ํด๋์ค์ ๊ตฌ์ฑ ์์์ ๋๋ค.
๊ฐ์ ํ์ ์ฐจํธ๋ฅผ ์ํ๋ ๊ฒฝ์ฐ ๋ค์์ ์๋ ํ ์ ์์ต๋๋ค.
https://antv.alipay.com/index.html
๋ชจ๋ ํ๋ก์ ํธ์์ ๋ฐ๋ณตํด์ ๊ตฌํํ๋ antd์์ ๋๋ฝ ๋ ๊ตฌ์ฑ ์์๋ ์คํ ์คํฌ๋ฆฐ ์ฌ์ด๋ ๋ฐ์ ๋๋ค.
react-sidebar ๋ ์ข์ ๊ตฌ์ฑ ์์์ด์ง๋ง ํ์ด์ง ์คํฌ๋กค๊ณผ ๊ด๋ จ๋ ๋ชจ๋ ๊ฒ์ ๊นจ๋จ ๋ฆฌ๋ฏ๋ก ๊ฝค ์ธ๋ชจ๊ฐ ์์ต๋๋ค. ํฐ์น ์ฅ์น์์ ์ค ์์ดํ ์ง์์ ์ ํธํ๋ ํตํฉ ์ฌ์ด๋ ๋ฐ๋ 3.0์ ๋ํ ๋์ ๊ฐ์ฅ ํฐ ์์์ด ๋ ๊ฒ์ ๋๋ค!
@JesperWe ๋น์ ์ด ํ์ํ ๊ฒ์ Layout.Sider ๋ผ๊ณ ์๊ฐํฉ๋๋ค.
@benjycui ์ฌ์ค ์ ๋ Sider๋ฅผ ๋ช ๋ฌ ๋์ ๋ณด์ง ์์์ต๋๋ค. 2.6 ์ดํ ์ฌ์ฉ์ ์ง์ ํธ๋ฆฌ๊ฑฐ๊ฐ ์์ผ๋ฏ๋ก ์ด์ ๋ณด๋ค ๋ ์ ์ฉํฉ๋๋ค. ๊ทธ๋ฌ๋ ์ฌ์ ํ ์ฝํ ์ธ ์ด์ด ํ์ ๋ ๋ ์ข์ ์ง๋๋ก ์์ถํ๋ฏ๋ก ์ฌ์ด๋ ๋ฐ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.
๊ทธ๋ฌ๋ ๋ช ๊ฐ์ง ์๋ก์ด ์ํ์ด์๋ ์ฌ์ด๋ ๋ฐ์ฒ๋ผ ์๋ํ๋๋ก ํ์ฅ ํ ์ ์์ต๋๋ค.
cover: true
ํ์ด์ง ์ฝํ
์ธ ๋ฅผ ์์ฐฉํ๋ ๋์ ์๋จ์ ํ์ํฉ๋๋ค.mask: true
-Sider๊ฐ ๋งจ ์์์์ ๋ ํ์ด์ง์ ๋ฎ์ง ์์ ๋ถ๋ถ์ ๋ง์คํฌ๋ฅผ ํ์ํฉ๋๋ค.maskCloseable: true
์ธ๋ถ์์ ํด๋ฆญํ๋ฉด ์ ํ๊ฒํฉ๋๋ค.๊ทธ๋ฆฌ๊ณ ๋ง์นจ๋ด ๊ฟ์ ์ธ๊ณ์์
swipeable: true
(ํ์ง๋ง antd๋ฅผ ๋ฐ์คํฌํฑ ์ฉ์ผ๋ก ์๊ฐํ๊ณ ์์ผ๋ฏ๋ก antd ์ธ๋ถ์์๋ ๊ฐ๋ฅํฉ๋๋ค).@benjycui @JesperWe Layout.Sider ๋ฐ๋ชจ์์ Sider๊ฐ ๋ชจ๋ฐ์ผ์์ ์ด๋ฆด ๋ ์ฝํ ์ธ ๊ฐ ์์ฐฉ๋ฉ๋๋ค (๋์).
์ฝํ ์ธ ๋ฅผ ์ค๋ฅธ์ชฝ์ผ๋ก ๋ฐ์ด ๋ฃ์ ์ ์์ต๋๊น? ์๋๋ฉด ์ฝํ ์ธ ์์ Sider๋ฅผ ๋ฐฐ์น ํ์๊ฒ ์ต๋๊น?
๋ ๋ค๋ฅธ ์ฃผ์ ๋ณ๊ฒฝ ์ฌํญ์ ๋ค์ ๋ฉ์ด์ ๋ฒ์ ์์ ์ํํ๊ณ ์กฐ์ธ์ ์ ๊ณตํ๊ธฐ๋ฅผ ๋ฐ๋๋๋ค .
@JesperWe ๊ทธ๋์, ํ์ํ ๊ฒ์ Drawer ์ ๊ฐ์ ๊ฒ์ ๋๋ค.
์ฌ๊ธฐ์ ๊ธฐ๋ฅ์ ๋ํ ์์ธํ ๋ด์ฉ์ ๋ ผ์ํ์ง ๋ง๊ณ ์ ๋ฌธ์ ๋ฅผ ์ด์ด ๋ ผ์ํ์ญ์์ค.
@benjycui Ok ๊ทธ๋์ ๋๋ ๋ด 3.0 ๊ฟ์ ๋ค์ ํํํฉ๋๋ค. :-) : Drawer ์ ๊ฐ์ ๊ฒ๋ค์ด antd์ ํตํฉ๋์์ต๋๋ค.
๊ฒฐ๊ณผ๋ฅผ ๋น๊ตํ๊ณ ๋กค์ ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํจ์ปค๋ก ๊ณ ๋ ค
๋ค์์ ๋ช ๊ฐ์ง ์๊ฐ์
๋๋ค.
https://medium.com/webpack/webpack-and-rollup-the-same-but-different-a41ad427058c
๊ฒฐ๊ณผ๋ฅผ ๋น๊ตํ๊ณ ๋กค์ ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํจ์ปค๋ก ๊ณ ๋ คํ์ญ์์ค.
2.x์์์ด ์์ ์ ์ํ ํ ์ ์์ต๋๋ค. ๊ฐ๋ฐ์๋ ๋ณ๊ฒฝ ์ฌํญ์ ๋๋ผ์ง ์์ ๊ฒ์ ๋๋ค.
๊ทธ๋ฆฌ๊ณ ์ด ์์ด๋์ด๋ฅผ ๋ ผ์ํ๊ธฐ ์ํด ์๋ก์ด ์ด์๋ฅผ ์ด ์ ์์ต๋๋ค @plandem
less๋ฅผ https://github.com/styled-components/styled-components ๋ก ๋ฐ๊พธ์ญ์์ค.
์คํ์ผ ๊ตฌ์ฑ ์์์ ๋ํด ๋๋ฌด ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
๊ทธ๋์ try
์กด์ฌํ๊ณ ํธํ์ฑ์ ์ฐ๋ฆฌ๊ฐ ๊ณ ๋ คํด์ผ ํ ํฐ ๋ฌธ์ ์
๋๋ค.
์ฐ๋ฆฌ๋ ํธํ์ฑ์ ์ํด ์ ์ฒด ํ์ฌ CSS ํด๋์ค ์ด๋ฆ์ ์ ์งํด์ผํ์ง๋ง ์คํ์ผ ๊ตฌ์ฑ ์์๋ ์คํ์ผ์ ๋ํ ์์ฒด ํด๋์ค ์ด๋ฆ์ ์์ฑํฉ๋๋ค. ์ค๋ณต์ฑ๊ณผ ์ ์ง ๊ด๋ฆฌ๊ฐ ์ด๋ ต์ต๋๊น?
์ฌ์ค ์ด๊ฒ์ ๋ฌธ์ ๊ฐ ์๋๋๋ค. ํ์ฌ CSS ํด๋์ค ์ด๋ฆ์ ํธํ์ฑ์์ํ ๊ฒ์ด ์๋๋ผ test (์ : ํจ์)์์ ์ฌ์ฉํ ์์๋ ์ ํ์์ ๋๋ค. ๊ทธ๋์ ์ฐ๋ฆฌ๋ ๊ทธ๋ค์ ์ง์ผ์ผํฉ๋๋ค.
ํธ์ ๋ด์ ๊ฐ๊ธฐ
Hiya, ์ ๋ ์คํ์ผ ๊ตฌ์ฑ ์์์ ํต์ฌ ๊ธฐ์ฌ์ ์ค ํ ๋ช ์ด๋ฉฐ์ด ์ค๋ ๋๋ ๋ฆฌํฌ์งํ ๋ฆฌ์ ์ด๋ฆฐ ๋ฌธ์ (์ ์ฐธ์กฐ)๋ก ์ธํด์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ SC๋ฅผ ์ง์ํ์ง ์๋๋ค๋ ์ฌ์ค์ ์๋ ค์ฃผ์์ต๋๋ค. ์ฐ์ฐํ์ด ๋ํ๋ฅผ ์ฐพ์์ต๋๋ค. : wink : โ ์ด์ ์ปจํ ์คํธ๋ฅผ ์ ์ณ๋๊ณ
autoprefixer ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ postcss์ ๋นํด ์ ๋ขฐ์ฑ์ด ๋จ์ด์ง ์ ์์ต๋๋ค.
์ฐ๋ฆฌ๋ ์ ์คํ๊ฒ stylis
๋ฅผ ์ ํ ํ์ผ๋ฉฐ์ด๋ฅผ ๊ฐ๋ฐํ๋
๊ฐ๋ฆฌํค๋ ํ์ผ์ ์ฌ์ฉ ์ค์ด ์๋๋ฉฐ ์ง๊ธ btw๋ก ์ญ์ ๋์์ผ๋ฉฐ inline-style-prefixer๊ฐ์๋ ์ด์ ์๋ ์ ๋์ฌ์ ์ผ๋ถ์ ๋๋ค. ํ์ง๋ง ๊ทธ๊ฒ์กฐ์ฐจ๋ @rofrischmann์ css-in-js ์ปค๋ฎค๋ํฐ๋ฅผ ํตํด ๋งค์ฐ ์ ๋ขฐํ ์์๋ ์๋ฃจ์ ์ ๋๋ค.
๋๋ ์ผ๋จ css-in-js๋ฅผ ์ ํํ๋ฉด px-to-rem๊ณผ ๊ฐ์ post-css ํ๋ฌ๊ทธ์ธ ์์คํ ์ ํธ๋ฆฌํจ์ ์๊ฒ ๋ ๊ฒ์ ๋๋ค.
ํ๊ทธ๊ฐ ์ง์ ๋ ํ ํ๋ฆฟ ๋ฆฌํฐ๋ด์ ๋ณด๊ฐ์์๋ ์๋ฌด JS ๋ ์ฌ์ฉํ ์ ์์ผ๋ฏ๋ก ๊ฐ๋จํ ํจ์๊ฐ ๋ชจ๋ ๊ฒ์ ๋์ฒด ํ ์ ์์ต๋๋ค. ์ค์ ๋ก CSS-in-JS์ lodash์ ๊ฐ์ "polished"๋ผ๋ ๋ณ๋์ ํ๋ก์ ํธ๊ฐ ์์ผ๋ฉฐ SASS / LESS์์ ๊ธฐ๋ํ ์์๋ ๋ชจ๋ ๋ฏน์ค ์ธ (์ : ๋์ฐ๋ฏธ ํจ์)๊ณผ ํจ๊ป ์ ๊ณต๋ฉ๋๋ค. https : // polished. js.org
(์ค์ ๋ก ์์์ ์ธ๊ธํ๋ฏ์ด PostCSS๋ฅผ ๋ ์ด์ ์ฌ์ฉํ์ง ์์ผ๋ฉฐ ํ๋ฌ๊ทธ์ธ btw๋ฅผ ์ง์ํ์ง๋ ์์ต๋๋ค)
์ฐ๋ฆฌ๋ ํธํ์ฑ์ ์ํด ์ ์ฒด ํ์ฌ CSS ํด๋์ค ์ด๋ฆ์ ์ ์งํด์ผํ์ง๋ง ์คํ์ผ ๊ตฌ์ฑ ์์๋ ์คํ์ผ์ ๋ํ ์์ฒด ํด๋์ค ์ด๋ฆ์ ์์ฑํฉ๋๋ค. ์ค๋ณต์ฑ๊ณผ ์ ์ง ๊ด๋ฆฌ๊ฐ ์ด๋ ต์ต๋๊น?
์ฌ์ฉ์ ์ ์ ํด๋์ค ์ด๋ฆ์ ์ฒจ๋ถํด์ผํ๋ ๊ฒฝ์ฐ .attrs
๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ฉด ์ฝ๊ฒ ๊ตฌ์ฑ ์์์ ์ถ๊ฐ ์ํ์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค๋ฉด :
const ButtonLink = styled.a.attrs({
className: 'your-custom-extra-classname'
})`
... // css and stuff
`
๋ ๋ง์ ์ฅ์ ๊ณผ ๊ธฐ๋ฅ :
css
๋์ฐ๋ฏธ๋ฅผ ์ฌ์ฉํ์ฌ ๋ฏน์ค ์ธ / ๊ณต์ ์คํ์ผ์ ์์ฑํ ์ ์์ต๋๋ค.๋์์ด ๋ ํ์ํ์๋ฉด ์ฌ๊ธฐ์ ์์ต๋๋ค. ๋ ๋ง์ ์ ๋ณด๊ฐ ํ์ํ๋ฉด ์๋ก์ด ์น ์ฌ์ดํธ๋ฅผ ํ์ธํ์ธ์ : 100 : https://styled-components.com
ํธ์ ๋ด์ ๊ฐ๊ธฐ
ํ์ฌ CSS ํด๋์ค ์ด๋ฆ์ ํธํ์ฑ์์ํ ๊ฒ์ด ์๋๋ผ test (์ : ํจ์)์์ ์ฌ์ฉํ ์์๋ ์ ํ์์ ๋๋ค. ๊ทธ๋์ ์ฐ๋ฆฌ๋ ๊ทธ๋ค์ ์ง์ผ์ผํฉ๋๋ค.
ํ ์คํธ์์๋ ๋๋ถ๋ถ์ ํด๋์ค ์ ํ๊ธฐ๋ ๋์ ํ์ ์ด๋ฆ ์ ํ๊ธฐ๋ก ๋์ฒด ๋ ์์๋ ๊ฒ์ฒ๋ผ ๋ณด์ ๋๋ค. ์ด๊ฒ์ ๋ชจ๋ ํ ์คํธ์ ํด๋น๋๋ ๊ฒ์ ์๋์ง๋ง ๋๋ถ๋ถ์ ๋ฐฉ๋ฒ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๋๋ ์ด๊ฒ์ ๋ฐ์๋ค์ด๋ ๊ฒ์ ๊บผ๋ฆฌ์ง ์์ ๊ฒ์ด๋ค.
์คํ์ผ ๊ตฌ์ฑ ์์๊ฐ ๋์์ด ๋ ์์๋ ํ ๊ณณ ์ ํ ๋ง ๋ฅผ
๋๋ ๋ ๋ฒ์งธ @philpl -Ant Design์์ ์คํ์ผ๋ง์ ํจ์ฌ ์ฝ๊ฒ ๋ง๋์ญ์์ค. ํ์ฌ๋ ์ ๋ง ๊ณ ํต ์ค๋ฝ์ต๋๋ค. styled-components
๋๋จํฉ๋๋ค.
styled-component
๋ฆฌํฉํฐ๋งํ๋ฉด https://github.com/ant-design/ant-design/issues/4998 ์ด ๋ฌธ์ ๋ฅผ ๋์์ ํด๊ฒฐํ ์ ์๋ค๊ณ ์๊ฐํฉ๋๋ค.
์ถ์ : ์ด๊ฒ์ styled-component
๊ฐ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์๋ค๋ ๊ฒ์ ์๋ฏธํ์ง๋ ์์ต๋๋ค. ๋จ์ง ์ฐ๋ฆฌ๊ฐ ์ผ์ ์ค์ด๊ธฐ ์ํด ๋์์ ์ด๊ฒ์ ํ ์ ์๊ธฐ ๋๋ฌธ์
๋๋ค.
์ ๋ฐ์ดํธ :
์ด๊ฒ์ด ์ ๊ฐ ํ์ฌ React ํ๋ก์ ํธ์์ Ant Design์ ์คํ์ผ๋งํ๋ ๋ฐฉ๋ฒ์
๋๋ค. _entire_ Ant Design ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ดํด๋ณด๊ณ ๋ชจ๋ ๊ฒ์ ์คํ์ผ๋งํด์ผํ๊ธฐ ๋๋ฌธ์ ๊ฐ์ฅ ํฐ ๊ฒ์ ์๋๋๋ค. ๋๋ create-react-app
์์ LESS ์ ์ฒ๋ฆฌ๊ธฐ๋ก ๋ฒ๊ฑฐ๋กญ๊ณ ์ถ์ง ์์ต๋๋ค. ์๋ํ๋ฉด ๊ทธ๊ฒ์ ์ผ์ข
์ ๊ณ ํต์ด๊ธฐ ๋๋ฌธ์
๋๋ค.
// <strong i="7">@flow</strong>
import { injectGlobal } from 'styled-components';
import Color from 'color';
/*
* We'll start with just one theme for now. Define colors and other styles here.
* More themes can be easily added later. Look in ./App.js to see where this
* theme is actually used.
*/
const mainTheme = {
primaryColor: Color('#fd3d57'),
primaryTextColor: Color('#fff'),
};
const defaultTheme = mainTheme;
// Inject global styles - seems to be the only way to customize Ant Design
// PLEASE ADD STYLES IN ALPHABETICAL ORDER for everyone's sanity. Thanks.
injectGlobal`
.ant-btn {
&:hover {
border-color: ${defaultTheme.primaryColor
.lighten(0.2)
.toString()} !important;
color: ${defaultTheme.primaryColor.lighten(0.2).toString()} !important;
}
&:active {
border-color: ${defaultTheme.primaryColor
.darken(0.2)
.toString()} !important;
color: ${defaultTheme.primaryColor.darken(0.2).toString()} !important;
}
}
.ant-btn-primary {
background-color: ${defaultTheme.primaryColor.toString()} !important;
border-color: ${defaultTheme.primaryColor.toString()} !important;
color: ${defaultTheme.primaryTextColor.toString()} !important;
&:hover {
background-color: ${defaultTheme.primaryColor
.lighten(0.2)
.toString()} !important;
border-color: ${defaultTheme.primaryColor
.lighten(0.2)
.toString()} !important;
color: ${defaultTheme.primaryTextColor.toString()} !important;
}
&:active {
background-color: ${defaultTheme.primaryColor
.darken(0.2)
.toString()} !important;
border-color: ${defaultTheme.primaryColor
.darken(0.2)
.toString()} !important;
color: ${defaultTheme.primaryTextColor.toString()} !important;
}
}
.ant-btn-clicked:after {
border: 0 solid ${defaultTheme.primaryColor.toString()} !important;
}
.ant-switch-checked {
background-color: ${defaultTheme.primaryColor.toString()} !important;
border-color: ${defaultTheme.primaryColor.toString()} !important;
}
`;
export default defaultTheme;
Ant Design์ด styled-components
์ ํธํ๋๋๋ก ๋ง๋ ๊ฒฝ์ฐ <ThemeProvider theme={primaryTheme}>
์ฑ์ ๋ํํ๋ฉด ๊ทธ์ ๋ฐ๋ผ ์คํ์ผ์ด ์ง์ ๋ฉ๋๋ค.
๋ด๊ฐ ๋์ ธ ๊ทธ๋ฅํ๊ณ ์ถ์ ํ ๋ผ์ ์ ์คํ์ผ - ๊ตฌ์ฑ ์์์ ๋์์ผ๋ก @rofrischmann์ ์ํด. ๋ ๋ชจ๋ํ ๋๊ณ ๋น ๋ฆ ๋๋ค. ๊ทธ๊ฒ์ ๋ง์ ๊ธฐ๋ฅ ๊ณผ ์์ ์ค์น ๋ฉด์ ์ด ์์ต๋๋ค. ๋ํ cloudflare ๋ ์คํ์ผ์ด ์ง์ ๋ ๊ตฌ์ฑ ์์ ๋์ UI๋ฅผ ๊ตฌ์ถํ๊ธฐ๋ก ๊ฒฐ์ ํ์ต๋๋ค.
์ฌ๋ฌ๋ถ์ด ๋ฌด์์ ๊ฒฐ์ ํ๋ , antd๊ฐ css-in-js ์๋ฃจ์ ์ ์ ๊ฒ ์ฌ์ฉํ๋ ๋์ ์ฌ์ฉํ๋ ๊ฒ์ ๋ณด๋ฉด ์ ๋ง ๊ธฐ์ฉ๋๋ค.
styled-components
์ ํ์ฅ ๊ฐ๋ฅํ ํ๋์ ์ธ ๋ชจ๋ ์ UI ๊ตฌ์ฑ ์์๋ฅผ ๊ตฌ์ถํ๋ ๋ฐ ๋ ๋์ ์ ํ์
๋๋ค.
๊ฐ์ฅ ์ค์ํ ๊ฒ์ ์ธ๋ถ CSS ํ์ผ์์ด ์ปดํฌ๋ํธ๋ฅผ ๋
๋ฆฝ์ ์ผ๋ก ๋ ๋๋ง ํ ์ ์๋ค๋ ๊ฒ์
๋๋ค.
์ต์ํ์ ํ์ ์คํ์ผ๋ก ๊ตฌ์ฑ ์์๋ฅผ ๋ถ๋ถ์ ์ผ๋ก ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค.
[email protected] ์ด ๊ทธ๊ฒ์ ์ฌ์ฉํ๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
https://github.com/ant-design/ant-design/tree/antd-3.0
@benjycui @yesmeck @ ddcat1115 @RaoHai
cc @nikogu
# 4853 ์ถ๊ฐ?
# 4853 ์ถ๊ฐ?
API์ ์ผ๋ถ๋ก key
๋ฅผ ์ฌ์ฉํ๋ ์ผ๋ถ ๊ตฌ์ฑ ์์์ ๊ฒฝ์ฐ ๋ชจ๋ API ์ด๋ฆ์ ์ด๋ฆ์ ๋ฐ๊ฟ ๋๊น์ง์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์์ต๋๋ค. ์
key => id
expandedKeys => expandedIds
selectedKeys => selectedIds
....
๋ธ๋ ์ดํน ์ฒด์ธ์ง์ด์ง๋ง ์ด๋ฌํ ์ข ๋ฅ์ ๋ธ๋ ์ดํน ์ฒด์ธ์ง๋ antd-codemod ๋ก ํด๊ฒฐํ ์ ์์ต๋๋ค.
์ฐ๋ฆฌ๋ # 4853์์ ๊ณ์ ๋ ผ์ ํ ์ ์์ต๋๋ค.
TypeScript๋ก ๋ฐ๋ชจ ๋ค์ ์์ฑ
๋ฐ๋ชจ๋ Typescript ์ ์ฉ์ ๋๊น ์๋๋ฉด JS์ Typescript ๋ชจ๋์ ๋๊น? ๋ ๋ค ์ ์งํ๊ณ ์ถ์ต๋๋ค.
https://github.com/react-bootstrap/react-overlays/issues/188
rc-trigger
์ด React 16์์ ์๋ํ๋์ง ํ์ธํ์ญ์์ค.
styled-components
๋๋ ์ ์ง ๊ด๋ฆฌ์ / ๊ณต๋ ์์
์์ css-in-js ์๋ฃจ์
์ด ์ฌ์ ํ ์ต์
์
๋๊น?
๋๋ ๊ทธ๊ฒ์ ์ข์ํ๊ณ ๋ฆฌํฉํ ๋ง์ ๋๊ณ ์ถ๋ค :)
๋ ์ ์ ํ์ผ์ ์คํ์ผ ๊ตฌ์ฑ ์์๋ก ๋ง์ด๊ทธ๋ ์ด์ ํ๋ ์์ ์ด ๋๋ฌด ๋ง๊ธฐ ๋๋ฌธ์ antd 3์์ ์คํ์ผ ๊ตฌ์ฑ ์์๋ฅผ ๋์ ํ์ง ์์ ๊ฒ ๊ฐ์ต๋๋ค. ๊ทธ๋ฌ๋ ์คํ์ผ ๊ตฌ์ฑ ์์๋ antd์ ์ฝ๋๋ฅผ ๋ฐฉํดํ์ง ์๊ณ antd์ ๊ตฌ์ฑ ์์์ ์คํ์ผ์ ์ ์ฉ ํ ์ ์์ผ๋ฏ๋ก ๋๊ตฐ๊ฐ ๊ด์ฌ์ด์๋ ๊ฒฝ์ฐ antd์ ํจ๊ป ์คํ์ผ ๊ตฌ์ฑ ์์๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ https://github.com/yesmeck/styled-antd ์ ์๊ฐ
@codepunkt @yesmeck ์ ๋งค๋ ฅ์ ์ธ antd์ ์๋ฅผ๋ณด๊ณ ์ถ์ดํฉ๋๋ค.
@yesmeck @ afc163 CSS-in-JS๋ฅผ ์ํด JSS๋ฅผ ์ฌ์ฉํ๋
์ฌ๊ธฐ์ ๋์ด๋ ์ฅ์ ์ด ์คํ์ผ ์ด
์๋ง๋ ํด๋ง ์ํ๊ณ์ ๋ ๊ด๋ จ์ด ์์์ง ๋ชจ๋ฅด์ง๋ง antd 3.0์ด babel 7๊ณผ ์ ์๋ํ๋์ง ํ์ธํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
ํนํ 7.0์์ ๊ณํ๋ ๋ฐ๋ฒจ ํ์
์คํฌ๋ฆฝํธ ๋ด์ฅ ์์ฑ๊ณผ ํจ๊ป.
create-react-app์ผ๋ก antd / typescript ์ฌ์ฉ์ ํฌ๊ฒ ๋จ์ํ ํ ์ ์์ต๋๋ค.
IE6-8, IE11 ์ดํ์ ๋ชจ๋ ๋ฒ์ ์ ๋ํ ์ง์์ ์ค๋จํ๋ ๊ฒ์ ๊ณ ๋ คํ์ญ์์ค.
CSS ํ์ผ์ ๋ ์๊ณ ๋น ๋ฅด๊ฒ ๋ค์ด๋ก๋ ํ ์ ์์ต๋๋ค. React๋ ๋ฒ์ 9 ์ดํ์ IE๋ ์ง์ํ์ง ์์ผ๋ฏ๋ก .clearfix, -ms-filter ๋ฑ์ ์์ ํ๊ฒ ์ ๊ฑฐ ํ ์ ์์ต๋๋ค.
ant๋ ์ด๋ฏธ ๊ณต์์ ์ผ๋ก IE9 + ๋ง ์ง์ํฉ๋๋ค.
2017 ๋
10 ์ 12 ์ผ ๋ชฉ์์ผ ์ค์ 7:58, Andreas Cederstrรถm <
[email protected]> ์์ฑ :
IE6-8, IE11 ์ดํ์ ๋ชจ๋ ๋ฒ์ ์ ๋ํ ์ง์์ ์ค๋จํ๋ ๊ฒ์ ๊ณ ๋ คํ์ญ์์ค.
CSS ํ์ผ์ ๋ ์๊ณ ๋น ๋ฅด๊ฒ ๋ค์ด๋ก๋ ํ ์ ์์ต๋๋ค. ๋ฐ์ํ์ง ์์ต๋๋ค
๋ฒ์ 9 ์ดํ์ IE๋ ์ง์ํ๋ฏ๋ก .clearfix, -ms-filter ๋ฑ์ ์์ ํ๊ฒ ์ฌ์ฉํ ์ ์์ต๋๋ค.
์ ๊ฑฐ๋์์ต๋๋ค.โ
์ด ์ค๋ ๋๋ฅผ ๊ตฌ๋ ํ๊ธฐ ๋๋ฌธ์์ด ๋ฉ์์ง๊ฐ ์ ์ก๋์์ต๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ณ GitHub์์ ํ์ธํ์ธ์.
https://github.com/ant-design/ant-design/issues/5570#issuecomment-336107229 ,
๋๋ ์ค๋ ๋ ์์๊ฑฐ
https://github.com/notifications/unsubscribe-auth/ADUIEIQi6tXJB0336SQrtMrMCIHfvjNuks5srf7pgaJpZM4MuJYf
.
ํ์ธ. antd.css (https://cdnjs.cloudflare.com/ajax/libs/antd/2.13.6/antd.css)์ ์ ๊ฑฐํด์ผ ํ IE6-8 ํดํน์ด ํฌํจ๋์ด ์๋์ง ํ์ธํ์ญ์์ค.
์:
/* IE6-IE8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=1, M12=0, M21=0, M22=1)";
zoom: 1;
.clearfix {
zoom: 1;
}
@andriijas ๋๋ ๊ทธ๊ฒ์ด antd-3.0
์์ ์ ๊ฑฐ๋์๋ค๊ณ ์๊ฐํฉ๋๋ค. ์ฌ์ ํ ํดํน์ด ๋ณด์ด๋ฉด PR ๋ง ์ ๊ฑฐํ์ญ์์ค. ๊ฐ์ฌํฉ๋๋ค.
์คํ์ผ ๊ตฌ์ฑ ์์์ ๊ฐ๋ฏธ ํ์์ ํฐ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. fieldDecorator๋ก ์ฅ์ ๋ ์์ ๊ตฌ์ฑ ์์๋ฅผ ์คํ์ผ ๊ตฌ์ฑ ์์๋ก ์คํ์ผ์ด ์ง์ ๋ ๋ํผ์ ๋ํํ๋ฉด ์์ ํ๋๊ฐ ์๋์ ๋ฉ ์ถฅ๋ ๋ค. ์ด ๋ฌธ์ ๋ฅผ ์ ๋ง ์ดํดํ์ง ๋ชปํ์ง๋ง ์ธ๋ผ์ธ ์คํ์ผ๋ก <div>
๋ก ๋ํํด์ผ ์๋ํฉ๋๋ค. ์ ๋ง ์ง์ฆ๋ ๋ค์ ...
์ฃผ ์ ํ๊ธฐ !!!
@malekjaroslav ๋ ์๋ชป๋ ์ฌ์ฉ๊ณผ ๊ด๋ จ์ด์์ ์ ์์ต๋๋ค. styled-components repo์ ๋ํ ๋ฌธ์ ๋ฅผ ์ด์ด์ ๋์ ๋๋ฆด ์ ์์ต๋๊น?
@benjycui antd3.0 ์ ๋ฐ์ ํ ๋์ฐ๋ฏธ์ ๋ํด ์ด๋ป๊ฒ ์๊ฐํ์ญ๋๊น? ์ด์ ๊ฐ์ https://github.com/twbs/bootstrap/blob/v4-dev/scss/utilities/_display.scss in react
import { Utils } from "antd";
const { Display } = Utils;
const Foo = props => (
<h1>
My idiotic example header
<Display xs="block" sm="inline" print="inline-block">my subheader is fantastic</Display>
</h1>
);
const Zoo = props => (
<h1>
My idiotic example header
<Display xs={{display: "block", className: ..}} sm="inline" print="hidden">my subheader is fantastic</Display>
</h1>
);
๋์์ด ํ์ํ๋ฉด ์ด๋์ PR์ ํ ์ ์์ง๋ง ๋ฌธ์ ๋ฒ์ญ ๋ฑ์ ๋์์ด ํ์ํฉ๋๋ค.
@andriijas ๋ https://github.com/contra/react-responsive๋ฅผ ์ฌ์ฉํฉ๋๋ค. Ant Design Specification์ ๋ฐ๋ฅด๋ UI ์ปดํฌ๋ํธ๋ฅผ antd์ ์ถ๊ฐํ๊ธฐ ๋งํ๋ฉด๋ฉ๋๋ค. ์ด์จ๋ ๊ฐ์ฌํฉ๋๋ค ๐
์, ant-design-pro ์ ์ฅ์์์ ๋ดค์ต๋๋ค. antd์์ ์ค๋จ ์ ์ ์ฌ์ฉํ์ฌ ๋ํผ๋ฅผ ๋ง๋ค ๊ฒ์ ๋๋ค.
์ด ๋ฆด๋ฆฌ์ค๋ฅผ ๊ธฐ๋ํฉ๋๋ค!
์๋ ํ์ธ์ ์ฌ๋ฌ๋ถ, ๋ฐฉ๊ธ [email protected]์ ์ถ์ https://github.com/ant-design/ant-design/issues/8233 ์ฐธ์กฐ
antd pro ๊ตฌ์ฑ ์์๊ฐ ๋์ฌ ๋๋ง ์ฌ์ฉํ ์ ์๊ธฐ ๋๋ฌธ์ ์ ๋ฒ์ ์ ์ถ์๋ฅผ ๊ณ ๋ํ๊ณ ์์ต๋๋ค. ์์ง ์๋ง์ ์ถ์ ํ ๊ณํ์ ๋๊น?
ํ๋ฅญํ ํ๋ฐํธ ์๋ ๊ตฌ์ฑ ์์๋ฅผ ์ ๊ณตํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. Google์ ์๋ฃ๋ฅผ ๋ฅ๊ฐํ์ต๋๋ค.
์๋ก์ด antd pro ๊ตฌ์ฑ ์์ ์ฌ์ฉ์ ์์ํ๋ ๋ฐ ๋ฐฉํด๊ฐ๋๋์ด ๋ฆด๋ฆฌ์ค์ ๋ํด ์ ๋ง ํฅ๋ถ๋ฉ๋๋ค. ์์๋๋ ๋ฆด๋ฆฌ์ค ๊ธฐ๊ฐ์ด 11 ์ ๋ง์ ๋๊น?
๋ฉ์ง ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ ๊ณต ํด์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. Google ๋จธํฐ๋ฆฌ์ผ UI๋ฅผ ๋ ๋ ๊ฒ์ ๋๋ค.
https://medium.com/ant-design/announcing-ant-design-3-0-70e3e65eca0c
Ant Design 3.0 ์ถ์! ๐ ๐ ๐
ํฅํ ๋ฆด๋ฆฌ์ค์์ ์คํ์ผ ๊ตฌ์ฑ ์์ / ๊ฐ์ / ํ ๋ผ ์ง์์ +1.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
ํธ์ ๋ด์ ๊ฐ๊ธฐ
Hiya, ์ ๋ ์คํ์ผ ๊ตฌ์ฑ ์์์ ํต์ฌ ๊ธฐ์ฌ์ ์ค ํ ๋ช ์ด๋ฉฐ์ด ์ค๋ ๋๋ ๋ฆฌํฌ์งํ ๋ฆฌ์ ์ด๋ฆฐ ๋ฌธ์ (์ ์ฐธ์กฐ)๋ก ์ธํด์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ SC๋ฅผ ์ง์ํ์ง ์๋๋ค๋ ์ฌ์ค์ ์๋ ค์ฃผ์์ต๋๋ค. ์ฐ์ฐํ์ด ๋ํ๋ฅผ ์ฐพ์์ต๋๋ค. : wink : โ ์ด์ ์ปจํ ์คํธ๋ฅผ ์ ์ณ๋๊ณ
์ฐ๋ฆฌ๋ ์ ์คํ๊ฒ
stylis
๋ฅผ ์ ํ ํ์ผ๋ฉฐ์ด๋ฅผ ๊ฐ๋ฐํ๋๊ฐ๋ฆฌํค๋ ํ์ผ์ ์ฌ์ฉ ์ค์ด ์๋๋ฉฐ ์ง๊ธ btw๋ก ์ญ์ ๋์์ผ๋ฉฐ inline-style-prefixer๊ฐ์๋ ์ด์ ์๋ ์ ๋์ฌ์ ์ผ๋ถ์ ๋๋ค. ํ์ง๋ง ๊ทธ๊ฒ์กฐ์ฐจ๋ @rofrischmann์ css-in-js ์ปค๋ฎค๋ํฐ๋ฅผ ํตํด ๋งค์ฐ ์ ๋ขฐํ ์์๋ ์๋ฃจ์ ์ ๋๋ค.
ํ๊ทธ๊ฐ ์ง์ ๋ ํ ํ๋ฆฟ ๋ฆฌํฐ๋ด์ ๋ณด๊ฐ์์๋ ์๋ฌด JS ๋ ์ฌ์ฉํ ์ ์์ผ๋ฏ๋ก ๊ฐ๋จํ ํจ์๊ฐ ๋ชจ๋ ๊ฒ์ ๋์ฒด ํ ์ ์์ต๋๋ค. ์ค์ ๋ก CSS-in-JS์ lodash์ ๊ฐ์ "polished"๋ผ๋ ๋ณ๋์ ํ๋ก์ ํธ๊ฐ ์์ผ๋ฉฐ SASS / LESS์์ ๊ธฐ๋ํ ์์๋ ๋ชจ๋ ๋ฏน์ค ์ธ (์ : ๋์ฐ๋ฏธ ํจ์)๊ณผ ํจ๊ป ์ ๊ณต๋ฉ๋๋ค. https : // polished. js.org
(์ค์ ๋ก ์์์ ์ธ๊ธํ๋ฏ์ด PostCSS๋ฅผ ๋ ์ด์ ์ฌ์ฉํ์ง ์์ผ๋ฉฐ ํ๋ฌ๊ทธ์ธ btw๋ฅผ ์ง์ํ์ง๋ ์์ต๋๋ค)
์ฌ์ฉ์ ์ ์ ํด๋์ค ์ด๋ฆ์ ์ฒจ๋ถํด์ผํ๋ ๊ฒฝ์ฐ
.attrs
๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ฉด ์ฝ๊ฒ ๊ตฌ์ฑ ์์์ ์ถ๊ฐ ์ํ์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค๋ฉด :๋ ๋ง์ ์ฅ์ ๊ณผ ๊ธฐ๋ฅ :
css
๋์ฐ๋ฏธ๋ฅผ ์ฌ์ฉํ์ฌ ๋ฏน์ค ์ธ / ๊ณต์ ์คํ์ผ์ ์์ฑํ ์ ์์ต๋๋ค.๋์์ด ๋ ํ์ํ์๋ฉด ์ฌ๊ธฐ์ ์์ต๋๋ค. ๋ ๋ง์ ์ ๋ณด๊ฐ ํ์ํ๋ฉด ์๋ก์ด ์น ์ฌ์ดํธ๋ฅผ ํ์ธํ์ธ์ : 100 : https://styled-components.com