react.js mean?
<Steps progressDot current={state ? state[0] ? state[0] : null : null}
status={this.checkStatus(state ? state[1] ? state[1] : null : null)}>
......
</Steps>
react.js mean?
<Steps progressDot current={state ? state[0] ? state[0] : null : null}
status={this.checkStatus(state ? state[1] ? state[1] : null : null)}>
......
</Steps>
that's probably what it means
state && state[0] ? state[0] : null
is equivalent to
state? (state [0]? State [0]: null): null
MDN has a good explanation. The important point about
is that although the conditional operator is combined to the right, the order in which it is evaluated is the
ternary control character of from left to right
to prevent null values. For example, data = [], wouldn't it be undefined to take data [0] directly
if (state){
if (state[0]){
return state[0]
} else {
return null
}
} else {
return null
}
react projects cannot save store? using redux, data index.js ReactDOM.render( <Provider store={store}> <Router > < Provider>, document.getElementById( root )) registerServiceWorker() actions export const SET_USER = ...
how to use react to change the value of Input < hr > export default class myForm extends Component{ constructor(props){ super(props); this.state = { id: , }; } change=()=>{ var idIn...
1 2 as shown in the two figures above: in the react component, it is known that all other environments are the same, except that there is an extra layer of arrow function in figure 1. Ask: why is it that in the scroll method of this component, this i...
Let me ask you a question. I use dva scaffolding to build the project. I want to use browserHistory as the background interface, but the packaged project is blank and there is no error! If you change to use the default hashHistory, it will be fine....
recently, a company project has a requirement to use input to query an attribute in table, and then the interface locates to that tr and changes the color to identify it. It seems that Table s api cannot be realized. Is there a good way to implement it?...
AB are elastic layouts A distance B minimum 20 A can compress B B minimum 30 AB is located at both ends of the horizontal how to implement this layout with flexbox? as shown in the figure: ...
at the home page, the message prompts you to jump to the Detail component to initialize the data that can only be rendered from Control. Clicking on a new message here will not trigger constructor, so I am dealing with nextProps data. If the time of the ...
{ "date":{"0":"20180201","1":"20180202","2":"20180205"}, "lines":{"0":3.3,"1":10.4,"2":79.721}, "count":{"0":5,"1":...
A single output data is OK, how to loop the data in the output interface? Solve? original <div id="demo">< div> <script type="text babel"> var UserGist = React.createClass({ getInitialStat...
there are multiple pages that need to have a property that needs to call the API to return judgment display logic my idea is to cache but how to write multiple pages to write code as little as possible want a rough code design framework it s not ho...
the "Application enabling platform " page is expanded by default. Radio selects a row in the table, id as a parameter, and the page that needs to be passed to the enterprise information. In topic, it is impossible to pass parameters in the form of call...
an error was prompted after using server-side rendering mobx Please also explain ...
Warning: Encountered two children with the same key, `.$4`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and or omitted the behavior is unsupported and could change i...
the updated value of the parent component is obtained from the child component, and then the updated value is passed to another child component , but what you get is undefined, that is, you can get the value before the parent component is updated. After...
after WebSocket was disconnected, I re-new a link. In the new connection, I can continue to receive and send data, but I found that ws.onmessage did not return the data after reconnection. I think he is still waiting for the data of the address before ...
currently only know the traditional usage const App = connect( mapStateToProps, mapDispatchToProps )(Counter); but many projects use @connect(state => ({ value: state.global.value, extinfo: state.extinfo, })) I can understand what i...
problem description When react creates components, it is recommended to use React.Component instead of React.CreateClass . The reason is that React.CreateClass will automatically bind functions, which will cause unnecessary performance overhead. ...
I have been studying redux for several days, and I am doing a redux dome, that adds, deletes, checks and modifies the data. I follow the tutorials I am looking for on the Internet, but I don t understand. so now there are several mistakes and there is...
the configuration is as follows: const webpack = require ( webpack ) const path = require ( path ) const fs = require ( fs ) const chalk = require ( chalk ) const HtmlWebpackPlugin = require ( html-webpack-plugin ) const WebpackMd5H...
HOC function: accepts Input | TextArea and other input components in the antd component, and injects the debounce method in lodash into the onchange event. The code is as follows: import {Input} from antd ; HOC(<Input >) ...