AG-2114 React Components are rendered to the root of the DOM tree

AG-2417 Issue with React 6: withRef is removed. To access the wrapped instance, use a ref on the connected component
AG-2439 Add support for react-redux v6

h/t @hrgui - thanks!
This commit is contained in:
Sean Landsman
2018-12-17 13:18:28 +00:00
parent c338f851e0
commit 2b49fb1b01
3 changed files with 8 additions and 15 deletions

View File

@@ -1,12 +1,9 @@
import React, {Component} from "react";
import * as PropTypes from "prop-types";
import {AgGridReact} from "ag-grid-react";
import {connect} from "react-redux";
import PriceRenderer from "./PriceRenderer";
import {AgGridReact} from "ag-grid-react";
const ThemeContext = React.createContext('light');
import PriceRenderer from "./PriceRenderer";
/*
* This component serves to display the row data (provided by redux)
@@ -49,7 +46,6 @@ class GridComponent extends Component {
rowData={this.props.rowData}
reactNext={true}
reduxStore={this.context.store} // must be supplied when using redux with reactNext
// events
onGridReady={this.onGridReady}>
@@ -59,10 +55,6 @@ 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

@@ -21,7 +21,8 @@ class PriceRenderer extends Component {
render() {
return (
<FontContext.Consumer>
{fontWeight => <span style={{fontWeight}}> {this.props.currencySymbol}{this.state.convertedValue}</span> }
{fontWeight => <span
style={{fontWeight}}> {this.props.currencySymbol}{this.state.convertedValue}</span>}
</FontContext.Consumer>
);
}
@@ -40,5 +41,5 @@ export default connect(
},
null,
null,
{withRef: true} // must be supplied for react/redux when using GridOptions.reactNext
{forwardRef: true} // must be supplied for react/redux when using GridOptions.reactNext
)(PriceRenderer);