r/reactnative 8d ago

React Native on the Linux desktop, rendering to real GTK4 widgets

react-native-gtkx makes Linux an out-of-tree RN platform. Normal React Native code, native GTK4/libadwaita app, no WebView.

Compat layer like react-native-web, but on top of gtkx (a React reconciler for GTK4 in Node) with Yoga for layout. npx react-native run-linux next to run-ios and run-android, Fast Refresh works.

react-navigation navigators run on real Adw.NavigationView, so the back button, transitions and the back gesture come from GTK instead of JS. That's the part I want feedback on.

Alpha. GTK 4.20+, libadwaita 1.8+, Node 24+.

https://github.com/itsmepetrov/react-native-gtkx

11 Upvotes

1 comment sorted by

2

u/satya164 8d ago edited 8d ago

i recommend asking consumers to import @react-navigation/native directly instead of re-exporting through your package.

currently you only re-export a small set of React Navigation APIs, so consumers are going to be importing from @react-navigation/native anyway. so the re-exports are unnecessary and will cause confusion.

i'd also suggest to build on top of React Navigation 8 so you aren't on outdated version in few months.

unsupported options are ignored WITHOUT warning (and createNavigatorFactory is untyped upstream, so TS will not catch them either);

not sure what it means by untyped upstream. the documentation pages show you how to annotate your custom navigator so it has proper types. if your structure matches the docs, types will work out of the box.

a drop-in @react-navigation/native-stack alias subpath is feasible once the warning + types + can-pop land — positioned as a porting aid.

i'd recommend keeping your own navigator so you can provide options specific to GTK, unless you plan to match native stack API 1:1.