Проблема интеграции нативных анимированных диаграмм React в проект ExpoJavascript

Форум по Javascript
Ответить
Anonymous
 Проблема интеграции нативных анимированных диаграмм React в проект Expo

Сообщение Anonymous »

Я пытаюсь получить основы из основной работы документации, но пакет каким -то образом не распознается в проекте.
Вот мой базовый код:

Код: Выделить всё

import { StatusBar } from 'expo-status-bar';
import { useState } from 'react';
import { Image } from 'expo-image';
import styles from './../../assets/styles/styles';
import { TextInput, Text, Modal, TouchableOpacity, View, Dimensions } from 'react-native';
// import { Ionicons } from '@expo-vector-icons';
import Feather from '@expo/vector-icons/Feather';
import { LineChartBicolor } from "react-native-gifted-charts"
import {ChartDot, ChartPath, ChartPathProvider, monotoneCubicInterpolation} from '@rainbow-me/animated-charts';

export const {width: SIZE} = Dimensions.get('window');

export const data = [
{x: 1453075200, y: 1.47}, {x: 1453161600, y: 1.37},
{x: 1453248000, y: 1.53}, {x: 1453334400, y: 1.54},
{x: 1453420800, y: 1.52}, {x: 1453507200, y: 2.03},
{x: 1453593600, y: 2.10}, {x: 1453680000, y: 2.50},
{x: 1453766400, y: 2.30}, {x: 1453852800, y: 2.42},
{x: 1453939200, y: 2.55}, {x: 1454025600, y: 2.41},
{x: 1454112000, y: 2.43}, {x: 1454198400, y: 2.20},
];

const points = monotoneCubicInterpolation({data, range: 40});

export function App() {
// We need to get the height of the phone and use it relatively,
// This is because height of phones vary
const windowHeight = Dimensions.get('window').height;

// This state would determine if the drawer sheet is visible or not
const [isBottomSheetOpen, setIsBottomSheetOpen] = useState(false);

// Function to open the bottom sheet
const handleOpenBottomSheet = () => {
setIsBottomSheetOpen(true);
};

// Function to close the bottom sheet
const handleCloseBottomSheet = () => {
setIsBottomSheetOpen(false);
};

return (


Privall
All safe Tron wallet

Telegram channel



{/* Wallet Card */}



112,349 TRX
77 Transactions

Send
Receive



{/* Wallet Card */}

{/* Chart */}






$7.12
-3.14%
24 hr


{/* Chart */}

);
}
< /code>
Ошибка указывает на следующую строку в редакторе: < /p>
import {ChartDot, ChartPath, ChartPathProvider, monotoneCubicInterpolation} from '@rainbow-me/animated-charts';
< /code>
говоря: < /p>

Не удалось найти файл объявления для модуля '@Rainbow-me /animated-Charts'. '/home/user/work/expo/privall-ts/node_modules/@rainbow-me/animated-charts/src/index.js' неявно имеет «любой тип».
try npm i ---Save- Dev @Types/Rainbow-Me__animated-Charts 
Если он существует, или добавьте новый файл объявления (.D.DS), содержащий модуль объявления ' @Rainbow-Me/Animated-Charts'; ts (7016)

Однако я попробовал npm i-save-dev @types/rainbow-me__memated-charts , но он вернул следующее в Конец: < /p>

Код: Выделить всё

npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/@types%2frainbow-me__animated-charts - Not found
npm error 404
npm error 404  '@types/rainbow-me__animated-charts@*' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-02-10T13_30_24_946Z-debug-0.log
Любое руководство приветствуется.

Подробнее здесь: https://stackoverflow.com/questions/794 ... po-project
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Javascript»