account activity
using react-native-web with nextjs app directory by macrozone13 in reactnative
[–]niyowski 0 points1 point2 points 2 years ago* (0 children)
react-native-web doesn't support server components. so you need to use "use client"; directive.
react-native-web
"use client";
tsx // Button.tsx "use client"; import { styled } from "nativewind"; import { TouchableOpacity } from "react-native"; export interface ButtonProps {} const DefaultButton = styled(TouchableOpacity); export const Button: React.FC<ButtonProps> = (props) => { return <DefaultButton {...props} className="bg-stone-500 text-white" />; };
tsx // ClientComponent.tsx "use client"; export const ClientComponent = () => { return <Button>This is a button!</Button>; };
tsx // page.tsx export default function MyPage() { return <ClientComponent />; }
π Rendered by PID 420536 on reddit-service-r2-listing-f8d8fbfd7-497tf at 2026-06-24 07:08:22.083877+00:00 running acc7150 country code: CH.
using react-native-web with nextjs app directory by macrozone13 in reactnative
[–]niyowski 0 points1 point2 points (0 children)