diff --git a/RNTester/js/RNTesterExampleList.js b/RNTester/js/RNTesterExampleList.js index c99b1b222e6fb9..5b8071a11dcc2c 100644 --- a/RNTester/js/RNTesterExampleList.js +++ b/RNTester/js/RNTesterExampleList.js @@ -75,7 +75,18 @@ const renderSectionHeader = ({section}) => ( class RNTesterExampleList extends React.Component { render() { const filterText = this.props.persister.state.filter; - const filterRegex = new RegExp(String(filterText), 'i'); + let filterRegex = /.*/; + + try { + filterRegex = new RegExp(String(filterText), 'i'); + } catch (error) { + console.warn( + 'Failed to create RegExp: %s\n%s', + filterText, + error.message, + ); + } + const filter = example => /* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an * error found when Flow v0.68 was deployed. To see the error delete this