AG-1905 Future proof ag-grid-react by removing dependency on unstable_renderSubtreeIntoContainer
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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);
|
||||
Reference in New Issue
Block a user