sample code error.js
class TypeError extends Error {};
const obj = new TypeError();
console.log('TypeError', obj instanceof TypeError);
console.log('Error', obj instanceof Error);
run node error.js
TypeError true
Error true
run babel-node error.js
TypeError true
Error true
but, run on react native.
2016-08-08 19:51:34.677 [info][tid:com.facebook.react.JavaScript] 'TypeError', false
2016-08-08 19:51:34.677 [info][tid:com.facebook.react.JavaScript] 'Error', true
I'd know why that TypeError is false,
node v6.3.1
react native v0.30
Please see this page -- http://stackoverflow.com/a/33877501/454967. It has more to do with JavaScript and Babel than React Native.
Most helpful comment
Please see this page -- http://stackoverflow.com/a/33877501/454967. It has more to do with JavaScript and Babel than React Native.