Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import React #182

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/charts/candle/DatetimeText.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import type { TextProps as RNTextProps } from 'react-native';
import type Animated from 'react-native-reanimated';

Expand Down
1 change: 1 addition & 0 deletions src/charts/candle/Line.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import { StyleSheet } from 'react-native';
import Svg, { Line as SVGLine, LineProps } from 'react-native-svg';

Expand Down
3 changes: 2 additions & 1 deletion src/charts/candle/PriceText.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import type { TextProps as RNTextProps } from 'react-native';
import type Animated from 'react-native-reanimated';
import type { TFormatterFn, TPriceType } from './types';

import type { TFormatterFn, TPriceType } from './types';
import { useCandlestickChartPrice } from './usePrice';
import { AnimatedText } from '../../components/AnimatedText';

Expand Down
16 changes: 7 additions & 9 deletions src/charts/line/Data.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TLineChartData } from './types';
import { createContext, useContext, useMemo } from 'react';
import React, { createContext, useContext, useMemo } from 'react';
import type { ReactNode } from 'react';
import type { TLineChartDataProp } from './types';

import type { TLineChartData, TLineChartDataProp } from './types';

export const DefaultLineChartId = '__LineChartData';

Expand Down Expand Up @@ -76,9 +76,8 @@ function validateLineChartId(dataContext: LineChartDataContext, id?: string) {
const joinedIds = otherIds.join(', ');

const suggestion = otherIds.length
? `Did you mean to use ${
singular ? 'this ID' : 'one of these IDs'
}: ${joinedIds}`
? `Did you mean to use ${singular ? 'this ID' : 'one of these IDs'
}: ${joinedIds}`
: `You didn't pass any IDs to your <LineChart.Provider />'s data prop. Did you mean to pass an array instead?`;

console.warn(
Expand All @@ -92,9 +91,8 @@ ${suggestion}`

const joinedIds = otherIds.join(', ');
const suggestion = otherIds.length
? `Did you mean to use ${
singular ? 'this ID' : 'one of these IDs'
}: ${joinedIds}`
? `Did you mean to use ${singular ? 'this ID' : 'one of these IDs'
}: ${joinedIds}`
: `You didn't pass any IDs to your <LineChart.Provider />'s data prop. Did you mean to pass an array instead?`;

console.error(`[react-native-wagmi-charts] Missing data "id" prop on LineChart. You must pass an id prop to <LineChart /> when using a dictionary for your data.
Expand Down
1 change: 1 addition & 0 deletions src/charts/line/DatetimeText.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import type { TextProps as RNTextProps } from 'react-native';
import type Animated from 'react-native-reanimated';

Expand Down
2 changes: 1 addition & 1 deletion src/charts/line/Group.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactNode, Children, cloneElement } from 'react';
import React, { ReactNode, Children, cloneElement } from 'react';
import { ViewProps, View } from 'react-native';
import flattenChildren from 'react-keyed-flatten-children';

Expand Down
2 changes: 2 additions & 0 deletions src/charts/line/HoverTrap/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
import React from 'react';

export const LineChartHoverTrap = () => <></>;
1 change: 1 addition & 0 deletions src/charts/line/PriceText.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import type { TextProps as RNTextProps } from 'react-native';
import type Animated from 'react-native-reanimated';

Expand Down
10 changes: 7 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
"compilerOptions": {
"baseUrl": "./",
"paths": {
"react-native-wagmi-charts": ["./src/index"],
"react-native-wagmi-charts": [
"./src/index"
],
},
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react-jsx",
"lib": ["esnext"],
"jsx": "react",
"lib": [
"esnext"
],
"module": "esnext",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
Expand Down