Installation
Get up and running with react-native-responsive-ui in seconds. No native linking required.
1
Install dependency
npm install @vincent-huy-uit/react-native-responsive-uiExpo Compatible
This library is a pure JavaScript solution. It works perfectly with Expo Go, Expo Dev Client, and bare React Native projects without any linking.
2
Verify Installation
Verify.js
import { s, useDeviceType } from "@vincent-huy-uit/react-native-responsive-ui";
import { View, Text } from "react-native";
export default function App() {
const device = useDeviceType();
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<Text style={{ fontSize: s(24) }}>
✅ Library works! Device: {device}
</Text>
</View>
);
}Troubleshooting
TypeScript Definitions
If you are using TypeScript, types are included in the package. No additional type definitions required.
Reset Cache
If you encounter resolution errors after installing, try resetting your metro bundler cache:
npx expo start -c.