4 ms·
Way cool! Looks like a common `Keyboard.js` will render either `KeyboardRender.js` on web/desktop or `KeyboardRender.ios.js` on mobile. KeyboardRender.ios.js:
by prezjordan 11y ago
Way cool! Looks like a common `Keyboard.js` will render either `KeyboardRender.js` on web/desktop or `KeyboardRender.ios.js` on mobile.
KeyboardRender.ios.js: https://github.com/benoitvallon/react-native-nw-react-calculator/blob/master/src/common/components/KeyboardRender.ios.js https://github.com/benoitvallon/react-native-nw-react-calcul...
KeyboardRender.js: https://github.com/benoitvallon/react-native-nw-react-calculator/blob/master/src/common/components/KeyboardRender.js https://github.com/benoitvallon/react-native-nw-react-calcul...
I'm wondering, though, if we can take this a step further and write Keyboard as the exact same code by composing it with more general components like `<View>` instead of `<div>`. This will require inline styles instead of class names, though.
I theorize that this will be made a little easier for you with the use of react-native-web: https://github.com/necolas/react-native-web https://github.com/necolas/react-native-web
Cool project, though, thanks for sharing. Code is very clean, I'll definitely be using it as a reference.
- jackweirdy 11y ago> This will require inline styles instead of class names, though That's probably not a bad thing; at the moment there's duplication of inline styles for the mobile view and styles in a CSS file for the web/desktop.