Skip to content

Commit a002728

Browse files
mayank-patelclaude
andcommitted
ci: rename master to main, update README with local testing instructions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 36a1450 commit a002728

4 files changed

Lines changed: 97 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [master, beta]
5+
branches: [main, beta]
66
pull_request:
7-
branches: [master, beta]
7+
branches: [main, beta]
88

99
jobs:
1010
build-and-test:

.github/workflows/deploy-demo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy Demo
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [main]
66

77
jobs:
88
deploy:

README.md

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ An animated floating label `<TextInput>` component for React Native (iOS, Androi
88

99
**[Live demo →](https://react-native-floating-labels.js.org)**
1010

11-
![Demo](https://raw.githubusercontent.com/mayank-patel/react-native-floating-labels/master/demo.gif)
11+
![Demo](https://raw.githubusercontent.com/mayank-patel/react-native-floating-labels/main/demo.gif)
1212

1313
---
1414

@@ -92,6 +92,98 @@ ref.current?.clear();
9292

9393
---
9494

95+
## Testing locally with a React Native app
96+
97+
The quickest way to test the library end-to-end against a real device or simulator before publishing.
98+
99+
### 1. Create a test app
100+
101+
**Expo (recommended — no Xcode/Android Studio required for quick tests):**
102+
103+
```bash
104+
npx create-expo-app@latest FloatingLabelsTest
105+
cd FloatingLabelsTest
106+
```
107+
108+
**Bare React Native:**
109+
110+
```bash
111+
npx @react-native-community/cli init FloatingLabelsTest
112+
cd FloatingLabelsTest
113+
```
114+
115+
### 2. Pack the library
116+
117+
Run this from the library root. It produces a tarball (e.g. `react-native-floating-labels-2.0.0.tgz`) that mirrors exactly what gets published to npm:
118+
119+
```bash
120+
npm run build
121+
npm pack
122+
```
123+
124+
### 3. Install the tarball in the test app
125+
126+
```bash
127+
npm install /path/to/react-native-floating-labels-2.0.0.tgz
128+
```
129+
130+
For Expo, no additional linking is required. For bare React Native, run `npx pod-install` on iOS.
131+
132+
### 4. Use it in the app
133+
134+
Replace the contents of `App.tsx` (or `App.js`) with:
135+
136+
```tsx
137+
import React, {useRef} from 'react';
138+
import {Button, SafeAreaView, StyleSheet} from 'react-native';
139+
import FloatingLabel, {FloatingLabelHandle} from 'react-native-floating-labels';
140+
141+
export default function App() {
142+
const ref = useRef<FloatingLabelHandle>(null);
143+
144+
return (
145+
<SafeAreaView style={styles.container}>
146+
<FloatingLabel style={styles.field}>First Name</FloatingLabel>
147+
<FloatingLabel style={styles.field} secureTextEntry>
148+
Password
149+
</FloatingLabel>
150+
<FloatingLabel ref={ref} style={styles.field}>
151+
Ref-controlled field
152+
</FloatingLabel>
153+
<Button title="Clear via ref" onPress={() => ref.current?.clear()} />
154+
</SafeAreaView>
155+
);
156+
}
157+
158+
const styles = StyleSheet.create({
159+
container: {flex: 1, padding: 24, backgroundColor: '#fff'},
160+
field: {marginBottom: 16},
161+
});
162+
```
163+
164+
### 5. Start the app
165+
166+
```bash
167+
# Expo
168+
npx expo start
169+
170+
# Bare React Native — iOS
171+
npx react-native run-ios
172+
173+
# Bare React Native — Android
174+
npx react-native run-android
175+
```
176+
177+
### Testing the beta release from npm
178+
179+
If you want to test the published beta instead of a local tarball:
180+
181+
```bash
182+
npm install react-native-floating-labels@beta
183+
```
184+
185+
---
186+
95187
## Contributing
96188

97189
See [CONTRIBUTING.md](./CONTRIBUTING.md) for the development workflow, Conventional Commits format, and release process.

release.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @type {import('semantic-release').GlobalConfig} */
22
module.exports = {
3-
branches: ['master', {name: 'beta', prerelease: true, channel: 'beta'}],
3+
branches: ['main', {name: 'beta', prerelease: true, channel: 'beta'}],
44
plugins: [
55
'@semantic-release/commit-analyzer',
66
'@semantic-release/release-notes-generator',

0 commit comments

Comments
 (0)