小编Raf*_*ael的帖子

React Native - 使用 Chart Kit 时出错(执行 UI 块时抛出异常:__NSCFNumber firstObject:发送到实例的无法识别的选择器)

我尝试使用 Chart Kit 库运行基本的 React Native 应用程序,但出现此错误: 单击查看图像:执行 UI 块时抛出异常:__NSCFNumber firstObject:无法识别的选择器发送到实例 0xa3576e305374b97e

有人知道如何修复它吗?

这是我的代码:

import React from 'react';
import { View, StyleSheet } from 'react-native';
import { LineChart, Grid } from 'react-native-svg-charts';

class LineChartExample extends React.PureComponent {
  render() {
    const data = [50, 10, 40, 95, -4, -24, 85, 91, 35, 53, -53, 24, 50, -20, -80];

    return (
        <LineChart
            style={{ height: 200 }}
            data={data}
            svg={{ stroke: 'rgb(134, 65, 244)' }}
            contentInset={{ top: 20, bottom: 20 }}
        >
          <Grid /> …
Run Code Online (Sandbox Code Playgroud)

reactjs react-native react-native-chart-kit

4
推荐指数
1
解决办法
2049
查看次数