@@ -139,28 +139,39 @@ const ResponsiveProvider = ({
139139 ) ;
140140} ;
141141
142+ const breakpointsPropTypes = {
143+ xs : PropTypes . string ,
144+ sm : PropTypes . string ,
145+ md : PropTypes . string ,
146+ lg : PropTypes . string ,
147+ xl : PropTypes . string ,
148+ } ;
149+
142150ResponsiveProvider . defaultProps = {
143151 initialMediaType : 'xs' ,
144152 defaultOrientation : null ,
145153} ;
146154
147155ResponsiveProvider . propTypes = {
148- initialMediaType : PropTypes . string ,
149- defaultOrientation : PropTypes . string ,
156+ initialMediaType : PropTypes . oneOf ( [
157+ '_initial' ,
158+ 'xs' ,
159+ 'sm' ,
160+ 'md' ,
161+ 'lg' ,
162+ 'xl' ,
163+ ] ) ,
164+ defaultOrientation : PropTypes . oneOf ( [ 'landscape' , 'portrait' ] ) ,
150165 children : PropTypes . oneOfType ( [
151166 PropTypes . arrayOf ( PropTypes . node ) ,
152167 PropTypes . node ,
153168 ] ) . isRequired ,
154- breakpoints : PropTypes . arrayOf (
155- PropTypes . shape ( {
156- mediaQuery : PropTypes . string ,
157- mediaType : PropTypes . string ,
158- } )
159- ) ,
160- // eslint-disable-next-line react/forbid-prop-types
161- mediaQueries : PropTypes . any ,
162- // eslint-disable-next-line react/forbid-prop-types
163- breakpointsMax : PropTypes . any ,
169+ breakpoints : PropTypes . exact ( breakpointsPropTypes ) ,
170+ breakpointsMax : PropTypes . exact ( breakpointsPropTypes ) ,
171+ mediaQueries : PropTypes . exact ( {
172+ ...breakpointsPropTypes ,
173+ _initial : PropTypes . string ,
174+ } ) ,
164175} ;
165176
166177export default ResponsiveProvider ;
0 commit comments