Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// $ExpectType Requireable
AirbnbPropTypes.nChildren(1, PropTypes.number);
// $ExpectType Requireable
AirbnbPropTypes.nChildren(1, AirbnbPropTypes.childrenOfType('span'));
// $ExpectType Requireable
AirbnbPropTypes.nonNegativeInteger;
// $ExpectType Requireable
AirbnbPropTypes.nonNegativeNumber();
// $ExpectType Requireable
AirbnbPropTypes.numericString();
// $ExpectType Requireable
const props: PropTypes.Requireable = AirbnbPropTypes.object();
// $ExpectType Requireable<{ foo: string; }>
AirbnbPropTypes.object<{ foo: string }>();
AirbnbPropTypes.or([PropTypes.bool.isRequired, AirbnbPropTypes.explicitNull().isRequired]);
AirbnbPropTypes.or([PropTypes.bool, PropTypes.number, PropTypes.arrayOf(PropTypes.string)]);
AirbnbPropTypes.or([PropTypes.number, PropTypes.string, PropTypes.bool], 'foo');
// $ExpectType Requireable
AirbnbPropTypes.range(0, 10);
// $ExpectType Requireable<5>
AirbnbPropTypes.range<5>(0, 10);
// $ExpectType Requireable>
AirbnbPropTypes.ref();
// $ExpectType Requireable
);
}
}
Header.propTypes = {
/** imports the utilityNav component */
utilityNav: PropTypes.shape(UtilityNav.propTypes).isRequired,
/** imports the headersearch component */
headerSearch: PropTypes.oneOfType([PropTypes.shape(HeaderSearch.propTypes), PropTypes.func]).isRequired,
searchRedirect: PropTypes.shape({
/** The base url that the user is redirected to when submitting a non-empty search value. */
baseUrl: PropTypes.string,
/** The URL query parameter that will be set to the value of the search input element. */
searchTermParam: PropTypes.string,
/** Optional extra query parameters to add to the redirect baseUrl. */
queryParams: airbnbPropTypes.object
}),
/** imports the mainnav component */
mainNav: PropTypes.shape(MainNav.propTypes).isRequired,
/** Adds a prop to hide header search in the header */
hideHeaderSearch: PropTypes.bool,
/** Adds a prop to not display go back to classic.mass.gov */
hideBackTo: PropTypes.bool,
/** siteLogo can be either a render prop or the SiteLogo component */
siteLogo: PropTypes.oneOfType([PropTypes.shape(SiteLogo.propTypes), PropTypes.func])
};
Header.defaultProps = {
hideHeaderSearch: false,
hideBackTo: true,
siteLogo: {
url: {