antd

this.setState not updating state

情到浓时终转凉″ 提交于 2020-07-10 10:37:06
问题 For some reason my this.state call is not updating the state in my roleClicked function. I can't seem to figure out what the problem is. Here is the code: import React, { Component } from 'react' import { Redirect } from 'react-router-dom'; import instance from '../../../config/axios'; import ls from 'local-storage'; import Sidenav from '../../layout/Sidenav' import isLoggedIn from '../../../helpers/isLoggedIn'; import redirectToLogin from '../../../helpers/redirectToLogin'; import

Why is there no onchange for `<Input>` in Ant design

不想你离开。 提交于 2020-07-08 12:39:35
问题 I know I must be missing something very simple but why is there no onChange for <Input> tag of Ant design ? I would like the update the value of an input. I assumed there was something like an onChange , since I was able to use onChange with DatePicker and handleChange DropDown ; but I guess I assumed wrong When I looked at the docs, there is a onPressEnter callback, but that is not really going to help me. I tried the following: <Input placeholder="Flight name" size="large" value={this.state

Change color of tick in ANTD Checkbox

北战南征 提交于 2020-07-03 17:31:05
问题 How can I change the color of thing tick inside a checkbox? This is what I have done: .ant-checkbox-checked .ant-checkbox-inner { color: #000000; background-color: #008000; } .ant-checkbox-checked .ant-checkbox-input { color: #000000; background-color: #000000; } 回答1: Add this css to your styles: .ant-checkbox-checked .ant-checkbox-inner:after { border-color: red !important; } 来源: https://stackoverflow.com/questions/62633496/change-color-of-tick-in-antd-checkbox

Set value to state React js

情到浓时终转凉″ 提交于 2020-07-03 10:03:18
问题 I need a bit of help. I am new to react, so I have stuck here. I have shared a sandbox box link. That Contains a Table. as below | Toy | Color Available | Cost Available | Now everything works perfectly. But I want to save the data of the table as below The detail state should contain a list of row values of the table and the columnsValues should contain the checkbox value of Color Available and Cost Available Example: this.state.detail like detail: [ { toy : ... color : ... cost : ... } {

React Ant Design - Form items to be split into 2 columns

人盡茶涼 提交于 2020-06-29 03:38:31
问题 I'm new to Ant Design and wanted to split my form items inside of the Form component into 2 columns on my page. I tried with flex-box and it's not working. There's this "formItemLayout" function as you can see in my code from their documentation but there's not so info for it. I don't know if I can use it to split them Is there any way to have them split into 2 halves on the page vertically (like into 2 columns, each taking 50% of the page) Any help would be appreciate. import React from

Storybook doesn't understand import on demand for antd components

浪尽此生 提交于 2020-06-27 07:40:44
问题 I have followed instructions here to get antd working fine with CRA . But while using it from storybook , I was getting an error as: Build fails against a mixin with message Inline JavaScript is not enabled. Is it set in your options? I had fixed that following suggestions on an issue I raised here. Now, storybook understands antd but not importing components on demand . Is babel has to be configured separately for storybook? 1 . On using import { Button } from "antd"; I get this: 2 . On

Expand a row by click of table on a certain condition Ant Design table react js

喜夏-厌秋 提交于 2020-06-23 11:24:46
问题 I need a small help. I need to write the code such that the table row should expand only when it's toggle is on when the toggle is off it should not expand. I have used the property expandRowByClick to expand a row when it is clicked. But here the problem is when the toggle is off it should not clickable, but right now an empty row will expand. How can I avoid it? Anyone help me out. Thank you. SandBox link: https://codesandbox.io/s/purple-sun-1rtz1?file=/index.js 回答1: just paste this code .

Where should i place the provider redux?

喜夏-厌秋 提交于 2020-06-17 15:57:11
问题 I am new to React and i try to do a JWT authentication, but there are some incompatibilities between the tutorials i found and the new antd, which i want to use. As the errors shown below, i tried to add a Provider, but i probably didn't place it correctly Can you help me, please? Here is my login page: import React from 'react'; import { Form, Icon, Input, Button, Spin } from 'antd'; import { connect } from 'react-redux'; import { NavLink } from 'react-router-dom'; import * as actions from '

Ant-Design Table not rendering when change state in mobx store

谁说我不能喝 提交于 2020-06-17 15:52:18
问题 I program the behavior of clicking on a row in the ant design Table component. This should change the rowClassName on the Table. Here is an example on CodeSendBox. When you click on a table row, the value in the Store.selectedRowKey changes, but the table is not re rendering. If you move the dividing slider to the sandbox and the table size changes, then rendering occurs and a new row selection is applied 回答1: Basically you don't use selectedRowKey inside your observer component, so that's

Ant-Design Table not rendering when change state in mobx store

坚强是说给别人听的谎言 提交于 2020-06-17 15:51:35
问题 I program the behavior of clicking on a row in the ant design Table component. This should change the rowClassName on the Table. Here is an example on CodeSendBox. When you click on a table row, the value in the Store.selectedRowKey changes, but the table is not re rendering. If you move the dividing slider to the sandbox and the table size changes, then rendering occurs and a new row selection is applied 回答1: Basically you don't use selectedRowKey inside your observer component, so that's