添加来自“@rainbow-me/animated-charts”的导入使 Expo 应用程序崩溃:“TypeError:this.InnerNativeModule.configureProps 不是函数。”
我正在使用 Windows 计算机,并使用 Yarn 和 Expo 开发 React Native 项目。 我正在尝试使用“@rainbow-me/animated-charts”。
以下是我根据他们的文档安装他们的软件包所采取的总结步骤。
安装了react-native-reanimated (~2.3.1)。
调整了我的 babel.config.js 文件。
已安装@rainbow-me/animated-charts (^1.0.0-alpha.6)
使用“expo start --clear”清除了 Expo 捆绑器缓存
我创建了一个单独的屏幕来使用其 Github 存储库中提供的示例代码来复制此问题:https://github.com/rainbow-me/react-native-animated-charts
import React from "react";
import { View, Text, Dimensions } from "react-native";
import {
ChartDot,
ChartPath,
ChartPathProvider,
monotoneCubicInterpolation,
} from "@rainbow-me/animated-charts";
export const { width: SIZE } = Dimensions.get("window");
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.1 },
{ x: 1453680000, y: 2.5 },
{ x: 1453766400, y: 2.3 },
{ x: 1453852800, y: 2.42 },
{ x: 1453939200, y: 2.55 },
{ x: 1454025600, y: 2.41 },
{ x: 1454112000, y: 2.43 },
{ x: 1454198400, y: 2.2 },
];
// const points = monotoneCubicInterpolation({ data, range: 40 });
const TestingScreen = () => {
return (
<View style={{ backgroundColor: "black" }}>
<ChartPathProvider data={{ points, smoothingStrategy: "bezier" }}>
<ChartPath height={SIZE / 2} stroke="yellow" width={SIZE} />
<ChartDot style={{ backgroundColor: "blue" }} />
</ChartPathProvider>
</View>
);
};
export default TestingScreen;
这里是问题
作为一旦我添加导入行:
import {
ChartDot,
ChartPath,
ChartPathProvider,
monotoneCubicInterpolation,
} from "@rainbow-me/animated-charts";
世博会崩溃,请参见下文:
有解决办法吗?
I am using a Windows computer and working on a React Native project using Yarn and Expo.
I am trying to use "@rainbow-me/animated-charts".
Here are the summarized steps I took to install their package, as per their documentation.
Installed react-native-reanimated (~2.3.1).
Adjusted my babel.config.js file.
Installed @rainbow-me/animated-charts (^1.0.0-alpha.6)
Cleared Expo bundler cache using "expo start --clear"
I created a separate Screen to replicate this issue using the example code provided in their Github repo:https://github.com/rainbow-me/react-native-animated-charts
import React from "react";
import { View, Text, Dimensions } from "react-native";
import {
ChartDot,
ChartPath,
ChartPathProvider,
monotoneCubicInterpolation,
} from "@rainbow-me/animated-charts";
export const { width: SIZE } = Dimensions.get("window");
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.1 },
{ x: 1453680000, y: 2.5 },
{ x: 1453766400, y: 2.3 },
{ x: 1453852800, y: 2.42 },
{ x: 1453939200, y: 2.55 },
{ x: 1454025600, y: 2.41 },
{ x: 1454112000, y: 2.43 },
{ x: 1454198400, y: 2.2 },
];
// const points = monotoneCubicInterpolation({ data, range: 40 });
const TestingScreen = () => {
return (
<View style={{ backgroundColor: "black" }}>
<ChartPathProvider data={{ points, smoothingStrategy: "bezier" }}>
<ChartPath height={SIZE / 2} stroke="yellow" width={SIZE} />
<ChartDot style={{ backgroundColor: "blue" }} />
</ChartPathProvider>
</View>
);
};
export default TestingScreen;
Here is the issue
As soon as I add the imports line:
import {
ChartDot,
ChartPath,
ChartPathProvider,
monotoneCubicInterpolation,
} from "@rainbow-me/animated-charts";
Expo crashes, see below:
Is there a solution to this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论