TypeError: Cannot read property 'slice' of undefined
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- react-native, typescript
- Domain
- mobile
Research direction
Start by reproducing the error from CurrencyScreen with the shown points data, then trace the call into LineGraphImpl and AnimatedLineGraph named in the stack trace. Determine which undefined value reaches the slice call and verify that the currency screen no longer produces the reported error.
Written by the indexing model from the issue text.
Description
export default function CurrencyScreen({ navigation, route }: CurrencyScreenProps) {
const { id } = route.params
const [dates, setDates] = useState<IValuteShowRequest>({
start_date: convertDateToString(
new Date(new Date().setDate(new Date().getDate() - 10))
),
end_date: convertDateToString(new Date())
})
const { data, isLoading, error } = useGetValuteQuery({
id,
body: dates
});
const preparedData = data?.data
const points = preparedData?.positions.map(position => {
return {
value: position.value,
date: parseDateFromString(position.date)
}
})
// const switchDate = (pos: 'start_date' | "end_date", date: Date) => {
// setDates(prev => { return { ...prev, [pos]: convertDateToString(date) } })
// }
if (isLoading) {
return <Loading />
}
if (error) {
return <Error />
}
return (
<View style={baseStyles.wrapper}>
<ScrollView style={baseStyles.scrollView}>
{points && <LineGraph color={Colors.blue500} animated={true} points={points} />}
</ScrollView>
</View>
);
}
ERROR TypeError: Cannot read property 'slice' of undefined
This error is located at:
in AnimatedLineGraph (created by LineGraphImpl)
in LineGraphImpl (created by CurrencyScreen)
in RCTView (created by View)
in View (created by ScrollView)
in RCTScrollView (created by ScrollView)
in ScrollView (created by ScrollView)
in ScrollView (created by CurrencyScreen)
in RCTView (created by View)
in View (created by CurrencyScreen)
in CurrencyScreen (created by SceneView)
in StaticContainer
in EnsureSingleNavigator (created by SceneView)
in SceneView (created by SceneView)
in RCTView (created by View)
in View (created by DebugContainer)
in DebugContainer (created by MaybeNestedStack)
in MaybeNestedStack (created by SceneView)
in RCTView (created by View)
in View (created by SceneView)
in RNSScreen (created by Animated(Anonymous))
in Animated(Anonymous) (created by InnerScreen)
in Suspender (created by Freeze)
in Suspense (created by Freeze)
in Freeze (created by DelayedFreeze)
in DelayedFreeze (created by InnerScreen)
in InnerScreen (created by Screen)
in Screen (created by SceneView)
in SceneView (created by NativeStackViewInner)
in Suspender (created by Freeze)
in Suspense (created by Freeze)
in Freeze (created by DelayedFreeze)
in DelayedFreeze (created by ScreenStack)
in RNSScreenStack (created by ScreenStack)
in ScreenStack (created by NativeStackViewInner)
in NativeStackViewInner (created by NativeStackView)
in RCTView (created by View)
in View (created by SafeAreaProviderCompat)
in SafeAreaProviderCompat (created by NativeStackView)
in NativeStackView (created by NativeStackNavigator)
in PreventRemoveProvider (created by NavigationContent)
in NavigationContent
in Unknown (created by NativeStackNavigator)
in NativeStackNavigator (created by Router)
in Router (created by App)
in AuthProvider (created by App)
in NotifProvider (created by App)
in EnsureSingleNavigator
in BaseNavigationContainer
in ThemeProvider
in NavigationContainerInner (created by App)
in RCTView (created by View)
in View (created by App)
in ThemeProvider (created by PaperProvider)
in RCTView (created by View)
in View (created by Portal.Host)
in Portal.Host (created by PaperProvider)
in RNCSafeAreaProvider (created by SafeAreaProvider)
in SafeAreaProvider (created by SafeAreaInsetsContext)
in SafeAreaProviderCompat (created by PaperProvider)
in PaperProvider (created by App)
in Provider (created by App)
in App (created by withDevTools(App))
in withDevTools(App)
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in main(RootComponent), js engine: hermes
- Dominant language
- TypeScript
- Stars
- 2.6k
- Forks
- 136
- Avg merge
- 5d 4h
- Merged PRs (30d)
- 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from margelo/react-native-graph
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
margelo/react-native-graph#132 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
margelo/react-native-graph#120 · 2 comments · 3 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
margelo/react-native-graph#103 · 7 comments · 3 reactions ·
-
Tooltip Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
margelo/react-native-graph#102 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
margelo/react-native-graph#89 · 1 reaction ·
All issues in margelo/react-native-graph
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·