Javascript 固定和#x27;js:1警告:不建议在严格模式下使用不安全的组件WillReceiveProps,这可能表明代码中存在错误;反应

Javascript 固定和#x27;js:1警告:不建议在严格模式下使用不安全的组件WillReceiveProps,这可能表明代码中存在错误;反应,javascript,reactjs,react-redux,Javascript,Reactjs,React Redux,我有一个更高阶的组件,它接收一个ex志愿者的comp和一个action,然后呈现一个包含志愿者信息的表: 志愿者薪酬代码: class Volenteer extends Component { render() { const title = 'רשימת מתנדבים'; const mode = 'work'; return ( <EntityTable columns

我有一个更高阶的组件,它接收一个ex志愿者的comp和一个action,然后呈现一个包含志愿者信息的表: 志愿者薪酬代码:

class Volenteer extends Component {
    render() {
        const title = 'רשימת מתנדבים';
        const mode = 'work';
        return (
            <EntityTable 
                columns = {columns}
                title = {title}
                mode = {mode}
                promiseProps = {this.props}
            />
        )
    }
}

export default WithEntity(Volenteer, requestVolunteerData() );
classevoleteer扩展组件{
render(){
const title=‘רשימתנים’;
常量模式=‘工作’;
返回(
)
}
}
导出带有实体的默认值(ovoleteer,requestAutonologData());
临时守则是:

import React, {Component} from 'react';
import { connect } from 'react-redux';

const WithEntity = (EntityComponent, action) => {

  const mapStateToProps = state => {
    return {
      isPending: state.requestEntitiesReducer.isPending,
      entities: state.requestEntitiesReducer.entities,
      error: state.requestEntitiesReducer.error
    }
  }
  
  const mapDispatchToProps = dispatch => {
    return {
      onRequestEntities: () => dispatch(action)
    }
  }

  class WithEntity extends Component {
    
    componentDidMount () {
      this.props.onRequestEntities();
    }

    

    render() {
      return (
        <EntityComponent {...this.props} />
      ) 
    }
  }

  return connect(mapStateToProps, mapDispatchToProps)(WithEntity);
}

export default WithEntity;
import React,{Component}来自'React';
从'react redux'导入{connect};
const with entity=(EntityComponent,action)=>{
常量mapStateToProps=状态=>{
返回{
isPending:state.requestEntitiesReducer.isPending,
实体:state.requestEntitiesReducer.entities,
错误:state.requestEntitiesReducer.error
}
}
const mapDispatchToProps=调度=>{
返回{
onRequestEntities:()=>分派(操作)
}
}
类WithEntity扩展组件{
组件安装(){
this.props.onRequestEntities();
}
render(){
返回(
) 
}
}
返回连接(mapStateToProps、mapDispatchToProps)(WithEntity);
}
与实体导出默认值;
它工作正常,但我收到以下警告:

关于这一点也有类似的问题,但没有找到解决方案,而且我已经绑定到实现componentDidUpdate,但它失败了。使用componentDidMount生命周期是否存在问题

编辑: 消息中提到的DataProvider、FilterProvider或SortProvider组件来自react-bootstrap-table-2组件:

const Table = ( {data, columns, mode} ) => {
    <div className = 'table-responsive fixed word-wrap scroll mapping_table'>
      <BootstrapTable 
        bootstrap4
        keyField={'id'}
        data={data}
        columns={columns} 
        responsive = {true}
        condensed
        hover
        pagination={ paginationFactory()} 
        filter={ filterFactory() }
        defaultSortDirection="asc"
      />
    </div>
}
 
export default Table;
const Table=({data,columns,mode})=>{
}
导出默认表;
以下是组件列表的图片:

这是
react-bootstrap-table-2
组件中的一个已知问题,与您粘贴的HOC代码无关:


您没有显示消息中提到的DataProvider、FilterProvider或SortProvider组件。您在写,我已经编辑了我的问题,它是否与react-bootstrap-table-2版本有关?好的,据我所知,仍然没有解决方案,(我尝试了从道具中获取交付状态的方法,但它不起作用)是否可以继续使用该方法并忽略警告或尝试其他库?您的选择是(a)忽略警告并希望没有任何中断(b)完成修复库的工作以获得更现代的反应,并可能加入PR(c)等待其他人完成该工作(d)切换到另一个库。好的,谢谢,我想删除stirct模式不是一个好主意(正如其他一些建议)