Skip to content

Commit ac60085

Browse files
authored
Merge pull request #3 from rahsheen/chore/prettierify
chore(prettier): hit all files and add log ignores
2 parents c871b8d + 4654cd6 commit ac60085

File tree

8 files changed

+30
-26
lines changed

8 files changed

+30
-26
lines changed

template/src/app/hooks/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import {useRef, useEffect} from 'react';
2-
import {useWindowDimensions, Animated} from 'react-native';
3-
import {TypedUseSelectorHook, useDispatch, useSelector} from 'react-redux';
4-
import {RootState, AppDispatch} from '../store';
1+
import { useRef, useEffect } from 'react';
2+
import { useWindowDimensions, Animated } from 'react-native';
3+
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
4+
import { RootState, AppDispatch } from '../store';
55

66
// Use throughout your app instead of plain `useDispatch` and `useSelector`
77
export const useAppDispatch = () => useDispatch<AppDispatch>();
88
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
99

1010
export const useViewportUnits = () => {
11-
const {width, height} = useWindowDimensions();
11+
const { width, height } = useWindowDimensions();
1212

1313
const vh = height / 100;
1414
const vw = width / 100;
1515

16-
return {vh, vw};
16+
return { vh, vw };
1717
};
1818

1919
export const useBounceAnimation = (value = 10) => {

template/src/app/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {configureStore, ThunkAction, Action} from '@reduxjs/toolkit';
1+
import { configureStore, ThunkAction, Action } from '@reduxjs/toolkit';
22
import counterReducer from '../features/counter/counterSlice';
33

44
export const store = configureStore({

template/src/components/AsyncButton.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {useRef} from 'react';
1+
import React, { useRef } from 'react';
22
import {
33
Animated,
44
GestureResponderEvent,
@@ -7,8 +7,12 @@ import {
77
StyleSheet,
88
View,
99
ViewStyle,
10+
LogBox,
1011
} from 'react-native';
1112

13+
// Ignore warnings from built-in Animated components that hate StrictMode
14+
LogBox.ignoreLogs([/Animated/]);
15+
1216
export function AsyncButton({
1317
onPress,
1418
style,

template/src/components/Header.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
'use strict';
1111

1212
import React from 'react';
13-
import {Animated, StyleSheet, View} from 'react-native';
14-
import {useViewportUnits, useBounceAnimation} from '../app/hooks';
13+
import { Animated, StyleSheet, View } from 'react-native';
14+
import { useViewportUnits, useBounceAnimation } from '../app/hooks';
1515

1616
const Header = () => {
17-
const {vh} = useViewportUnits();
17+
const { vh } = useViewportUnits();
1818
const bounce = useBounceAnimation();
1919
const height = 40 * vh;
2020

@@ -23,7 +23,7 @@ const Header = () => {
2323
<Animated.Image
2424
accessibilityRole={'image'}
2525
source={require('./logo.gif')}
26-
style={{height, transform: [{translateY: bounce}]}}
26+
style={{ height, transform: [{ translateY: bounce }] }}
2727
/>
2828
</View>
2929
);

template/src/components/LearnReduxLinks.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
'use strict';
1212

1313
import React from 'react';
14-
import {View, Text, StyleSheet, TouchableOpacity} from 'react-native';
14+
import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
1515
// @ts-ignore
1616
import openURLInBrowser from 'react-native/Libraries/Core/Devtools/openURLInBrowser';
17-
import {Colors} from 'react-native/Libraries/NewAppScreen';
17+
import { Colors } from 'react-native/Libraries/NewAppScreen';
1818

1919
const links = [
2020
{

template/src/features/counter/Counter.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import React, {useState} from 'react';
1+
import React, { useState } from 'react';
22
import {
33
StyleSheet,
44
Text,
55
TextInput,
66
TouchableOpacity,
77
View,
88
} from 'react-native';
9-
import {useAppDispatch, useAppSelector} from '../../app/hooks';
10-
import {AsyncButton} from '../../components/AsyncButton';
9+
import { useAppDispatch, useAppSelector } from '../../app/hooks';
10+
import { AsyncButton } from '../../components/AsyncButton';
1111
import {
1212
decrement,
1313
increment,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export function fetchCount(currentCount = 0, amount = 1) {
2-
return new Promise<{data: number}>(resolve =>
3-
setTimeout(() => resolve({data: currentCount + amount}), 1000),
2+
return new Promise<{ data: number }>(resolve =>
3+
setTimeout(() => resolve({ data: currentCount + amount }), 1000),
44
);
55
}

template/src/features/counter/counterSlice.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {createAsyncThunk, createSlice, PayloadAction} from '@reduxjs/toolkit';
2-
import {RootState} from '../../app/store';
3-
import {fetchCount} from './counterAPI';
1+
import { createAsyncThunk, createSlice, PayloadAction } from '@reduxjs/toolkit';
2+
import { RootState } from '../../app/store';
3+
import { fetchCount } from './counterAPI';
44

55
interface CounterState {
66
value: number;
@@ -19,9 +19,9 @@ const initialState: CounterState = {
1919
export const incrementAsync = createAsyncThunk<
2020
number,
2121
number,
22-
{state: {counter: CounterState}}
23-
>('counter/fetchCount', async (amount: number, {getState}) => {
24-
const {value} = getState().counter;
22+
{ state: { counter: CounterState } }
23+
>('counter/fetchCount', async (amount: number, { getState }) => {
24+
const { value } = getState().counter;
2525
const response = await fetchCount(value, amount);
2626
return response.data;
2727
});
@@ -57,7 +57,7 @@ export const counterSlice = createSlice({
5757
},
5858
});
5959

60-
export const {increment, decrement, incrementByAmount} = counterSlice.actions;
60+
export const { increment, decrement, incrementByAmount } = counterSlice.actions;
6161

6262
// The function below is called a selector and allows us to select a value from
6363
// the state. Selectors can also be defined inline where they're used instead of

0 commit comments

Comments
 (0)