最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。
The shouldComponentUpdate() format of the method is as follows:
shouldComponentUpdate(nextProps, nextState) shouldComponentUpdate() method returns a Boolean value that specifies whether React should continue rendering. The default value is true thatis, state the component is re-rendered each time it changes.
shouldComponentUpdate() is used to determine whether the output of the React component is affected by the current state or props the impact of the change, when props or state when there is a change shouldComponentUpdate() will be called before the rendering is executed.
The following example demonstrates The following example demonstrates shouldComponentUpdate() method returns false the action performed when (cannot be modified by clickingthe button): 3.17.1. Example ¶
classHeaderextendsReact.Component{constructor(props){super(props);this.state={favoritesite:"runoob"};}shouldComponentUpdate(){returnfalse;}changeSite=()=>{this.setState({favoritesite:"google"});}render(){return(<div> <h1>My favorite website is{this.state.favoritesite}h1> <buttontype="button"onClick={this.changeSite}>modifybutton> div>);}}ReactDOM.render(<Header/>,document.getElementById('root'));
shouldComponentUpdate() method returns true (click the button to modify it): 3.17.2. Example ¶
classHeaderextendsReact.Component{constructor(props){super(props);this.state={favoritesite:"runoob"};}shouldComponentUpdate(){returntrue;}changeSite=()=>{this.setState({favoritesite:"google"});}render(){return(<div> <h1>My favorite website is{this.state.favoritesite}h1> <buttontype="button"onClick={this.changeSite}>modifybutton> div>);}}ReactDOM.render(<Header/>,document.getElementById('root'));