AG-1905 Future proof ag-grid-react by removing dependency on unstable_renderSubtreeIntoContainer

This commit is contained in:
MrSafferty
2018-07-16 14:49:45 +01:00
parent 60181add9a
commit 449a88e832
3 changed files with 14 additions and 4 deletions

View File

@@ -64,9 +64,8 @@
"d3": "4.9.1",
"file-loader": "0.11.1",
"lodash": "4.17.4",
"react": "16.0.0",
"react-dom": "16.0.0",
"react-dom-factories": "1.0.2",
"react": "16.4.1",
"react-dom": "16.4.1",
"react-redux": "5.0.x",
"react-router-dom": "4.2.x",
"redux": "3.6.x",

View File

@@ -1,4 +1,5 @@
import React, {Component} from "react";
import * as PropTypes from "prop-types";
import {AgGridReact} from "ag-grid-react";
import {connect} from "react-redux";
@@ -45,6 +46,9 @@ class GridComponent extends Component {
columnDefs={this.state.columnDefs}
rowData={this.props.rowData}
reactNext={true}
reduxStore={this.context.store} // must be supplied when using redux with reactNext
// events
onGridReady={this.onGridReady}>
</AgGridReact>
@@ -53,6 +57,10 @@ class GridComponent extends Component {
}
}
GridComponent.contextTypes = {
store: PropTypes.object // must be supplied when using redux with reactNext
};
// pull off row data changes
export default connect(
(state) => {

View File

@@ -33,5 +33,8 @@ export default connect(
currencySymbol: state.currencySymbol,
exchangeRate: state.exchangeRate
}
}
},
null,
null,
{ withRef: true } // must be supplied for react/redux when using GridOptions.reactNext
)(PriceRenderer);