This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { View } from 'react-native'; | |
import codePush from 'react-native-code-push'; | |
const MyApp = () => <View />; | |
export default codePush(MyApp); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { View } from 'react-native'; | |
import codePush from 'react-native-code-push'; | |
const MyApp = () => <View />; | |
export default codePush({ | |
updateDialog: true, | |
checkFrequency: codePush.CheckFrequency.ON_APP_RESUME, | |
installMode: codePush.InstallMode.ON_NEXT_RESUME, | |
})(MyApp); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project.ext.react = [ | |
entryFile: "index.js", | |
enableHermes: true | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_react_native!( | |
:path => config[:reactNativePath], | |
# to enable hermes on iOS, change `false` to `true` and | |
then install pods | |
:hermes_enabled => true | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const GameList = () => { | |
const {isLoading, data} = useGetGames(); | |
const [gameLikes, setGameLikes] = React.useState<any>({}); | |
const likeGame = (id: number) => { | |
setGameLikes((prevState: any) => { | |
return { | |
...prevState, | |
[id]: prevState[id] ? prevState[id] + 1 : 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jest.mock('../hooks', () => ({ | |
useGetGames: () => ({ | |
data: { | |
pages: [ | |
{ | |
results: Array.from({length: 1000}, () => ({ | |
id: Math.random() * 10000, | |
name: Math.random().toString(36).substring(7), | |
background_url: `https://i.imgur.com/${Math.random() | |
.toString(36) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const initialWindowMetrics = { | |
frame: { | |
x: 0, | |
y: 0, | |
width: 0, | |
height: 0, | |
}, | |
insets: { | |
top: 0, | |
left: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createWrapper = () => { | |
return (node: JSX.Element) => ( | |
<NativeBaseProvider initialWindowMetrics={initialWindowMetrics}> | |
{node} | |
</NativeBaseProvider> | |
); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {NativeBaseProvider} from 'native-base'; | |
import {measurePerformance} from 'reassure'; | |
import {GameList} from './GameList'; | |
jest.setTimeout(60_000); | |
jest.mock('../hooks', () => ({ | |
useGetGames: () => ({ | |
data: { | |
pages: [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"metadata":{}} | |
{"name":"GameList perf test","runs":10,"meanDuration":480.2,"stdevDuration":31.957610813214572,"durations":[516,506,505,504,495,488,473,456,431,428],"meanCount":1,"stdevCount":0,"counts":[1,1,1,1,1,1,1,1,1,1]} |
OlderNewer