react-native-animated-charts icon indicating copy to clipboard operation
react-native-animated-charts copied to clipboard

undefined is not an object (evaluating '_ref5.x')

Open hugoh59 opened this issue 3 years ago • 0 comments

Getting the following error

undefined is not an object (evaluating '_ref5.x')


map@[native code]
_f
[native code]
_f
[native code]

ABI42_0_0reanimated::ABI42_0_0REAIOSErrorHandler::raiseSpec()
    ABI42_0_0REAIOSErrorHandler.mm:17
ABI42_0_0reanimated::ErrorHandler::raise()
ABI42_0_0reanimated::NativeReanimatedModule::onRender(double)
invocation function for block in ABI42_0_0reanimated::createReanimatedModule(std::__1::shared_ptr<ABI42_0_0facebook::ABI42_0_0React::CallInvoker>)::$_4::operator()(std::__1::function<void (double)>, ABI42_0_0facebook::jsi::Runtime&) const
-[ABI42_0_0REANodesManager onAnimationFrame:]
CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long)
display_timer_callback(__CFMachPort*, void*, long, void*)
__CFMachPortPerform
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
__CFRunLoopDoSource1
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start
0x0

Here is my code:

using "expo": "^42.0.5", "react-native-reanimated": "~2.2.0", "react-native-redash": "^16.2.3", "@rainbow-me/animated-charts": "^1.0.0-alpha.6",

Index.tsx

const buildGraph = (data) => {
  for(let i in data.t) {
    pointsValues.push({
                x: parseFloat(i) as number,
                y: data.c[i] as number,
            });
}

useEffect(() => {
  fetch().then(data => {
                const response = buildGraph(data);
                setPoints(response);
            });
}, [ selectedPeriod ] );

return(
  ...
  <Graph data={points}/>
  ...
)

Graph.tsx

import React from "react";
import {
  View, Text, StyleSheet, TouchableOpacity , Dimensions, TextInput, Platform, Animated
} from 'react-native';

import 'react-native-reanimated'
import { mixPath, useVector } from "react-native-redash";
import { parse } from "react-native-redash";
import {ChartDot, ChartPath, ChartPathProvider, monotoneCubicInterpolation} from '@rainbow-me/animated-charts';

const SIZE = Dimensions.get("window").width;

const Graph = ({ data }: any) => {
    const points = monotoneCubicInterpolation({data, range: 7000});

    // return (<View/>)
    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 Graph;

Graph looks like this but then error message shows up on top. Capture d’écran 2022-03-01 à 10 27 20

hugoh59 avatar Mar 01 '22 09:03 hugoh59