question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ref stopped working sometimes after version

See original GitHub issue

I used to be able to pass a ref to calendar and extract some data for example like this calendarRef.current?.state.currentMonth. In the recent versions of the library, the ref just returns undefined.

Expected Behavior

Expect to be able to get the ref of the calendar

Environment

Please run these commands in the project folder and fill in their results:

react-native-calendars version: 1.1282.0 react-native version: 0.65.1

Here is some simple code that already fails to get the ref.

const calendarRef = useRef<Calendar>(null);

<Calendar
            ref={calendarRef}
            ...
/>

And we can even do something like this, and the inner ref comes back as undefined

<Calendar
            ref={ref => console.log('Ref is', ref)}
            ...
/>

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:31

github_iconTop GitHub Comments

2reactions
KrisLaucommented, May 5, 2022

Having a similar issue with trying to add a reference to AgendaList and calling agendaListRef.current.chooseDay()

1reaction
Inbal-Tishcommented, Jun 9, 2022

@KrisLau Yes, you can’t scroll to an item that was not rendered, but the AgendaList’s scroll is handled by the ExpandableCalendar (that’s the whole point), you should not manage it yourself. If you need to change the date, change it in the CalendarProvider’s date prop and the date should change in both the calendar and agenda list.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Refrigerator Troubleshooting & Repair - HomeTips
This expert refrigerator troubleshooting and repair advice includes how to fix refrigerator problems such as poor cooling, refrigerator noises, ...
Read more >
What Makes a Fridge Stop Working? - Networx
If Your Fridge Has Stopped And The Light is Off​​ As obvious as this sounds, often a fridge shuts down completely because it's...
Read more >
Refrigerator Not Cooling: What Can Cause a Fridge to Stop ...
If after checking for different possible causes and troubleshooting your fridge it still isn't cooling properly, then you may have a faulty circuit...
Read more >
Fridge Stopped working, how to fix? - YouTube
This is the most common problem with all types of Fridges , from mini fridge to full size fridge.
Read more >
Refrigerator Won't Start - Top 6 Reasons & Fixes - YouTube
67K views 2 years ago Refrigerator Troubleshooting ... Reason #1: Run Capacitor: The run capacitor helps the capacitor run after it starts.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found