@@ -1973,7 +1973,7 @@ var ChartComponent = function (_React$Component) {
1973
1973
return true ;
1974
1974
}
1975
1975
1976
- var nextData = this . transformDataProp ( ) ;
1976
+ var nextData = this . transformDataProp ( nextProps ) ;
1977
1977
return ! ( 0 , _lodash2 . default ) ( this . shadowDataProp , nextData ) ;
1978
1978
}
1979
1979
} , {
@@ -1983,11 +1983,15 @@ var ChartComponent = function (_React$Component) {
1983
1983
}
1984
1984
} , {
1985
1985
key : 'transformDataProp' ,
1986
- value : function transformDataProp ( ) {
1987
- var data = this . props . data ;
1988
-
1989
- var node = _reactDom2 . default . findDOMNode ( this ) ;
1990
- return typeof data == "function" ? data ( node ) : data ;
1986
+ value : function transformDataProp ( props ) {
1987
+ var data = props . data ;
1988
+
1989
+ if ( typeof data == "function" ) {
1990
+ var node = _reactDom2 . default . findDOMNode ( this ) ;
1991
+ return data ( node ) ;
1992
+ } else {
1993
+ return data ;
1994
+ }
1991
1995
}
1992
1996
1993
1997
// Chart.js directly mutates the data.dataset objects by adding _meta proprerty
@@ -2002,7 +2006,7 @@ var ChartComponent = function (_React$Component) {
2002
2006
return ;
2003
2007
}
2004
2008
2005
- var data = this . transformDataProp ( ) ;
2009
+ var data = this . transformDataProp ( this . props ) ;
2006
2010
2007
2011
this . shadowDataProp = _extends ( { } , data , {
2008
2012
datasets : data . datasets && data . datasets . map ( function ( set ) {
@@ -2018,7 +2022,7 @@ var ChartComponent = function (_React$Component) {
2018
2022
var options = this . props . options ;
2019
2023
2020
2024
2021
- var data = this . memoizeDataProps ( ) ;
2025
+ var data = this . memoizeDataProps ( this . props ) ;
2022
2026
2023
2027
if ( ! this . chart_instance ) return ;
2024
2028
0 commit comments