Skip to content

Commit e06fdaf

Browse files
committed
style: lint
1 parent 91c1c78 commit e06fdaf

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

example/src/App.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* @format
66
*/
77

8-
import type React from "react";
9-
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
10-
import { FastImageTab } from "./FastImageTab";
11-
import { NitroImageTab } from "./NitroImageTab";
12-
import { createStaticNavigation } from "@react-navigation/native";
13-
import { EmptyTab } from "./EmptyTab";
14-
import { NitroAssetImageTab } from "./NitroAssetImageTab";
8+
import type React from 'react';
9+
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
10+
import { FastImageTab } from './FastImageTab';
11+
import { NitroImageTab } from './NitroImageTab';
12+
import { createStaticNavigation } from '@react-navigation/native';
13+
import { EmptyTab } from './EmptyTab';
14+
import { NitroAssetImageTab } from './NitroAssetImageTab';
1515

1616
const Tabs = createBottomTabNavigator({
1717
detachInactiveScreens: false,

example/src/NitroAssetImageTab.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
import React, { useEffect, useState } from 'react';
22
import { FlatList, StyleSheet, Text, View } from 'react-native';
33
import { Image, loadImageFromAssetAsync, NitroImage } from 'react-native-nitro-image';
4-
import { CameraRoll } from "@react-native-camera-roll/camera-roll";
4+
import { CameraRoll } from '@react-native-camera-roll/camera-roll';
55

66

77
function useAssetImage(
88
url: string,
99
): Image | undefined {
10-
const [image, setImage] = useState<Image | undefined>(undefined)
10+
const [image, setImage] = useState<Image | undefined>(undefined);
1111

1212
useEffect(() => {
1313
const load = async () => {
1414
try {
15-
const i = await loadImageFromAssetAsync(url.replace(/^ph:\/\//, ""))
16-
setImage(i)
15+
const i = await loadImageFromAssetAsync(url.replace(/^ph:\/\//, ''));
16+
setImage(i);
1717
} catch (error) {
18-
console.error(`Failed to load image from "${url}"!`, error)
19-
setImage(undefined)
18+
console.error(`Failed to load image from "${url}"!`, error);
19+
setImage(undefined);
2020
}
21-
}
22-
load()
21+
};
22+
load();
2323
// `options` is missing from dependencies since it's a reference type that will be constructed each render.
24-
// eslint-disable-next-line react-hooks/exhaustive-deps
25-
}, [url])
2624

27-
return image
25+
}, [url]);
26+
27+
return image;
2828
}
2929
function AsyncImageImpl({ url }: { url: string }): React.ReactNode {
3030
const image = useAssetImage(url);
@@ -37,7 +37,7 @@ export function NitroAssetImageTab() {
3737

3838

3939
useEffect(() => {
40-
CameraRoll.getPhotos({ first: 100,assetType: "Photos" }).then((res) => {
40+
CameraRoll.getPhotos({ first: 100,assetType: 'Photos' }).then((res) => {
4141
setImageURLs(res.edges.map((edge) => edge.node.image.uri));
4242
});
4343
}, []);

0 commit comments

Comments
 (0)