Loading optional dependencies via try-catch has been added in Metro 0.59, which in turn means that you should be able to use your original code in React Native 0.63 if you turn it on in metro.config.js:
module.exports = {
transformer: {
allowOptionalDependencies: true,
},
}