Open UpperCod opened 2 years ago
I'm curious how this will look, because we are using React Native (Web) and currently have 2 different packages, one for React Native and one for WebComponents. We already share a lot of code, but when we can develop React Native components directly with Atomico, this would be amazing 😃
Excellent!, from atomico@1.59 we can replace the virtualDOM render according to the environment, this allows us:
I have pending work on 2 tasks:
Since it's an exclusive integration for React, it should work like this:
import { wrapper } from "@atomico/react-native";
import { MyComponent } from "./my-component";
export const ReactNativeMyComponent = wrapper(MyComponent );
For now that's the goal 🤓
Okay! I really wanna help out with this, to make it possible.
div
-> View
, span
-> Text
; and maybe button
can be mapped to Pressable
. But what about other components like TouchableOpacity
, etc.? . What about special components like SafeAreaView
, KeyboardAvoidingView
and ScrollView
?aria-*
attributes must be converted to accessibility*
props. All event listeners like onclick
have to be mapped somehow (for example onclick
-> onPress
, which is also not supported for a normal View
)className
is not supported, so we need to resolve CSS selectors and apply them to the style
prop of the certain elements.Dimensions
API – I already did that for many projects.Next question would be: What about Animations with the Animated
API? 😄 And also other APIs, like Appearance
(for Color Mode), AccessibilityInfo
, etc. Maybe there could be a special set of hooks containing React Native APIs that are also working for Web.
I think all that is not so easy as it sounds, because I'm working with React Native since about 6 years now, and we also are using React Native Web for developing Design Systems here at IBM iX.
Of course it would be interesting then when we have React Native support, also add support for React Native Web to bring everything back to Web 🤯
EDIT: FYI, we use React Native styles (a package containing all React Native styles as simple objects) and convert them using stylis and then use them with Atomico
Amazing (Sorry for the delay in my response), I'm going to centralize this in a repo, so we can work on this together
Through the strategy already used in atomico/ssr it is possible to support React Native.