The ability to find the required width for a render of the barcode data allows figuring out the largest line width that can be used for a particular view, and even determining when the barcode data will not fit in a view. (Finding the view size requires something like https://cmichel.io/how-to-get-the-size-of-a-react-native-view-dynamically). I'm new to JavaScript and React Native, so there might be problems with this code, but it does seem to work.
The ability to find the required width for a render of the barcode data allows figuring out the largest line width that can be used for a particular view, and even determining when the barcode data will not fit in a view. (Finding the view size requires something like https://cmichel.io/how-to-get-the-size-of-a-react-native-view-dynamically). I'm new to JavaScript and React Native, so there might be problems with this code, but it does seem to work.