Throw an error when header is invalid

This commit is contained in:
Brent Vatne
2018-06-27 17:22:00 -07:00
parent 3dd3f5b804
commit bb5719f438
2 changed files with 7 additions and 0 deletions

View File

@@ -120,6 +120,12 @@ class StackViewLayout extends React.Component {
const { options } = scene.descriptor;
const { header } = options;
if (__DEV__ && typeof header === 'string') {
throw new Error(
`Invalid header value: "${header}". The header option must be a valid React component or null, not a string.`
);
}
if (header === null && headerMode === 'screen') {
return null;
}