Skip to content

Commit a5294fe

Browse files
Upgrade example to 0.70 and use typescript (#427)
* feat: upgrade example to rn 0.70 & typescript * fix: remove explicit typing * Temporarily disable Windows example build Until react-native-windows is released with v0.70 we should not include it. So to keep the checks green and to avoid false-negative check on Windows build, the `build-Windows-app` job has been disabled. * fix: typo in SliderExamle * fix: bring back vertical slider example * fix: add all config files and comment out windows config * feat: remove flipper from example * feat: change entry and config files to .ts or .json * feat: remove index.web.ts React native web support was removed here: ddffbca Co-authored-by: BartoszKlonowski <[email protected]>
1 parent 4be2dd7 commit a5294fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+40417
-14267
lines changed

.github/workflows/ReactNativeSlider-CI.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -198,19 +198,20 @@ jobs:
198198
working-directory: example/ios
199199

200200

201-
build-Windows-app:
202-
name: Build example app Windows
203-
runs-on: windows-latest
204-
needs: [verify]
205-
steps:
206-
- name: Ensure the cross-platform Git on Windows
207-
run: git config --global core.autocrlf false
208-
209-
- name: Checkout repository
210-
uses: actions/checkout@v3
211-
212-
- name: Install dependencies
213-
run: npm install
214-
215-
- name: Build the Windows OS app
216-
run: cd example; npx react-native run-windows --arch x64 --no-launch --no-deploy --logging
201+
# Disabled until Windows Example app is added with v0.70
202+
# build-Windows-app:
203+
# name: Build example app Windows
204+
# runs-on: windows-latest
205+
# needs: [verify]
206+
# steps:
207+
# - name: Ensure the cross-platform Git on Windows
208+
# run: git config --global core.autocrlf false
209+
#
210+
# - name: Checkout repository
211+
# uses: actions/checkout@v3
212+
#
213+
# - name: Install dependencies
214+
# run: npm install
215+
#
216+
# - name: Build the Windows OS app
217+
# run: cd example; npx react-native run-windows --arch x64 --no-launch --no-deploy --logging

example/.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
module.exports = {
22
root: true,
33
extends: '@react-native-community',
4+
parser: '@typescript-eslint/parser',
5+
plugins: ['@typescript-eslint'],
6+
overrides: [
7+
{
8+
files: ['*.ts', '*.tsx'],
9+
rules: {
10+
'@typescript-eslint/no-shadow': ['error'],
11+
'no-shadow': 'off',
12+
'no-undef': 'off',
13+
},
14+
},
15+
],
416
};

example/.flowconfig

Lines changed: 0 additions & 66 deletions
This file was deleted.

example/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ build/
3030
local.properties
3131
*.iml
3232
*.hprof
33+
.cxx/
3334

3435
# node.js
3536
#

example/.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16

example/App.js

Lines changed: 0 additions & 52 deletions
This file was deleted.

example/App.tsx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import React from 'react';
2+
import {Platform, ScrollView, StyleSheet, Text, View} from 'react-native';
3+
import {examples} from './SliderExample';
4+
5+
const App = () => {
6+
return (
7+
<ScrollView
8+
style={styles.scrollView}
9+
contentContainerStyle={styles.container}>
10+
<Text testID="testTextId" style={styles.title}>
11+
{'<Slider />'}
12+
</Text>
13+
{examples
14+
.filter(e => !e.platform || e.platform === Platform.OS)
15+
.map((e, i) => (
16+
<View key={`slider${i}`} style={styles.sliderWidget}>
17+
<Text style={styles.instructions}>{e.title}</Text>
18+
{e.render()}
19+
</View>
20+
))}
21+
</ScrollView>
22+
);
23+
};
24+
25+
export default App;
26+
27+
const styles = StyleSheet.create({
28+
scrollView: {
29+
backgroundColor: '#F5FCFF',
30+
},
31+
container: {
32+
justifyContent: 'center',
33+
alignItems: 'center',
34+
paddingVertical: 20,
35+
},
36+
title: {
37+
fontSize: 20,
38+
textAlign: 'center',
39+
width: '100%',
40+
marginVertical: 20,
41+
},
42+
instructions: {
43+
textAlign: 'center',
44+
color: '#333333',
45+
marginBottom: 5,
46+
fontSize: 20,
47+
},
48+
sliderWidget: {
49+
marginVertical: 30,
50+
},
51+
});

0 commit comments

Comments
 (0)