diff --git a/src/SizesContext.js b/src/SizesContext.js index d397ebe..04a773d 100644 --- a/src/SizesContext.js +++ b/src/SizesContext.js @@ -1,6 +1,8 @@ import React from 'react' const SizesContext = React.createContext({ + // Keep these fields in sync with the excluded fields in the `render()` + // function of `withSizes.js` fallbackWidth: null, fallbackHeight: null, forceFallback: false, diff --git a/src/withSizes.js b/src/withSizes.js index ef7fb16..d99b58f 100644 --- a/src/withSizes.js +++ b/src/withSizes.js @@ -75,9 +75,12 @@ const withSizes = (...mappedSizesToProps) => WrappedComponent => { render() { const { + // Ensure all the `SizesContext.js` arguments are excluded. + // Keep this in sync with `SizesContextjs` fields fallbackHeight, fallbackWidth, forceFallback, + throttle, ...otherProps } = this.props