christopherdro / christopherdro/react-native-calendar

Nothing renders on Android with RN 0.50.3

Open
#177 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
536
Forks
233
PR merge metrics
No merged PRs in 30d

Description

This issue description might be a bit vague, but in our app, the calendar disappeared (shows nothing) on Android after upgrading both to RN `0.50.3` and `react-native-calendar` to `0.13.1`.

After some investigation, we think that this code causes the error:
```
if (this.state.containerWidth == null) {
return ;
}
```

The theory is that `onContainerLayout` doesn't get `width` and `height`, or doesn't run at all. We haven't verified this though, hence vague :)

We set `width` and `height` on `containerStyle` and suddenly the calendar appears.

This was not a problem with RN `0.44.2` and `react-native-calendar@0.10.0` on Android. We were unable to test versions between 0.10.0 and the latest, since only the latest imports `prop-types` from its own package, instead of from the 'react' package.
We haven't tested it with other versions of RN either, because time :)

Sorry about not writing an awesome issue, but I thought it was better to report it like this, rather than not at all.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the component containing the shown containerWidth and onContainerLayout logic, then reproduce the calendar on Android with React Native 0.50.3 and react-native-calendar 0.13.1. Verify whether the layout callback supplies dimensions or runs at all; done means the calendar renders without requiring explicit width and height in containerStyle.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.