antd

React and antd: Router doesn't re-render components

本秂侑毒 提交于 2021-01-07 02:41:49
问题 I have a simple web page with login and search pages. I also have a navbar at the top to allow for switching between the two. The basic App.js looks as follows: const history = createBrowserHistory(); function App() { return ( <Router history={history}> <CustomLayout> <Switch> <BaseRouter/> </Switch> </CustomLayout> </Router> ); } export default App; Now, the BaseRouter and CustomLayout are just const BaseRouter = () => ( <div> <Route exact path={"/list"} component={ItemsList}/> <Route path={

React and antd: Router doesn't re-render components

回眸只為那壹抹淺笑 提交于 2021-01-07 02:41:46
问题 I have a simple web page with login and search pages. I also have a navbar at the top to allow for switching between the two. The basic App.js looks as follows: const history = createBrowserHistory(); function App() { return ( <Router history={history}> <CustomLayout> <Switch> <BaseRouter/> </Switch> </CustomLayout> </Router> ); } export default App; Now, the BaseRouter and CustomLayout are just const BaseRouter = () => ( <div> <Route exact path={"/list"} component={ItemsList}/> <Route path={

TypeError: Cannot read property '0' of undefined Webpack

我是研究僧i 提交于 2021-01-05 07:57:41
问题 I'm trying to create a demo of ant-design for that I've installed ant-design and now when I'm hitting npm start I got this error dora: listened on 8000 📦 1/2 build modules/opt/lampp/htdocs/antddemo/node_modules/webpack/lib/ExternalModuleFactoryPlugin.js:19 const dependency = data.dependencies[0]; ^ TypeError: Cannot read property '0' of undefined at /opt/lampp/htdocs/antddemo/node_modules/webpack/lib/ExternalModuleFactoryPlugin.js:19:40 at /opt/lampp/htdocs/antddemo/node_modules/atool-build

TypeError: Cannot read property '0' of undefined Webpack

℡╲_俬逩灬. 提交于 2021-01-05 07:57:14
问题 I'm trying to create a demo of ant-design for that I've installed ant-design and now when I'm hitting npm start I got this error dora: listened on 8000 📦 1/2 build modules/opt/lampp/htdocs/antddemo/node_modules/webpack/lib/ExternalModuleFactoryPlugin.js:19 const dependency = data.dependencies[0]; ^ TypeError: Cannot read property '0' of undefined at /opt/lampp/htdocs/antddemo/node_modules/webpack/lib/ExternalModuleFactoryPlugin.js:19:40 at /opt/lampp/htdocs/antddemo/node_modules/atool-build

Override Antd's selected Item color

此生再无相见时 提交于 2021-01-05 07:46:47
问题 I want to override the background-color property of the ant-menu-item-selected class. By default it appears blue. import { Menu } from 'antd'; const { Item } = Menu; //item2 will be rendered with the class 'ant-menu-item-selected' const MyComp = () => ( <Menu theme="dark" defaultSelectedKeys={["item2"]} mode="horizontal"> <Item key="item1">Item 1</Item> <Item key="item2">Item 2</Item> </Menu> ); ReactDOM.render(<MyComp />,document.getElementById('root')); How should I do? Thank you for your

Override Antd's selected Item color

狂风中的少年 提交于 2021-01-05 07:46:33
问题 I want to override the background-color property of the ant-menu-item-selected class. By default it appears blue. import { Menu } from 'antd'; const { Item } = Menu; //item2 will be rendered with the class 'ant-menu-item-selected' const MyComp = () => ( <Menu theme="dark" defaultSelectedKeys={["item2"]} mode="horizontal"> <Item key="item1">Item 1</Item> <Item key="item2">Item 2</Item> </Menu> ); ReactDOM.render(<MyComp />,document.getElementById('root')); How should I do? Thank you for your

AntDesign TabPane min-height 100%

ⅰ亾dé卋堺 提交于 2020-12-06 06:37:58
问题 Using Ant.Design Tabs https://ant.design/components/tabs/ How can I set styling on TabPane so that it's min-height is always 100% height of the window even when it's empty? Below example should cover the window with color #F5F5F5 回答1: This has worked for me. <TabPane tab={tab.title} key={index}> <Row> <Col style={{minHeight: "100vh", maxheight: "100vh"}}> Test </Col> </Row> </TabPane> 回答2: So this has worked for me too <Tabs onChange={() => { console.log("oi"); }} type="card" style={{

AntDesign TabPane min-height 100%

爱⌒轻易说出口 提交于 2020-12-06 06:35:28
问题 Using Ant.Design Tabs https://ant.design/components/tabs/ How can I set styling on TabPane so that it's min-height is always 100% height of the window even when it's empty? Below example should cover the window with color #F5F5F5 回答1: This has worked for me. <TabPane tab={tab.title} key={index}> <Row> <Col style={{minHeight: "100vh", maxheight: "100vh"}}> Test </Col> </Row> </TabPane> 回答2: So this has worked for me too <Tabs onChange={() => { console.log("oi"); }} type="card" style={{

AntDesign TabPane min-height 100%

Deadly 提交于 2020-12-06 06:35:23
问题 Using Ant.Design Tabs https://ant.design/components/tabs/ How can I set styling on TabPane so that it's min-height is always 100% height of the window even when it's empty? Below example should cover the window with color #F5F5F5 回答1: This has worked for me. <TabPane tab={tab.title} key={index}> <Row> <Col style={{minHeight: "100vh", maxheight: "100vh"}}> Test </Col> </Row> </TabPane> 回答2: So this has worked for me too <Tabs onChange={() => { console.log("oi"); }} type="card" style={{

AntDesign TabPane min-height 100%

血红的双手。 提交于 2020-12-06 06:35:15
问题 Using Ant.Design Tabs https://ant.design/components/tabs/ How can I set styling on TabPane so that it's min-height is always 100% height of the window even when it's empty? Below example should cover the window with color #F5F5F5 回答1: This has worked for me. <TabPane tab={tab.title} key={index}> <Row> <Col style={{minHeight: "100vh", maxheight: "100vh"}}> Test </Col> </Row> </TabPane> 回答2: So this has worked for me too <Tabs onChange={() => { console.log("oi"); }} type="card" style={{