React-native-calendars: height in style not changing the height of the calendar

Created on 18 Sep 2019  路  5Comments  路  Source: wix/react-native-calendars

Please make our job easier by filling this template out to completion. If you're requesting a feature instead of reporting a bug, please feel free to skip the Environment and Reproducible Demo sections.

Description

I set style={{ width: width - 54, height: 300 }}.
width changes fine with the given input, but height stays the same regardless of the value I put in for height.

Expected Behavior

I set style={{ width: width - 54, height: 300 }}, and expected the height to fit in.

Observed Behavior

height did not change

If there's an error message, please paste the full terminal output and error message in this code block:

Error text goes here!

Environment

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

  • npm ls react-native-calendars: 1.170
  • npm ls react-native: 0.59.4

Also specify:

  1. Phone/emulator/simulator & version:

Reproducible Demo

Please provide a minimized reproducible demonstration of the problem you're reporting.

Issues that come with minimal repro's are resolved much more quickly than issues where a maintainer has to reproduce themselves.

stale

Most helpful comment

HI @seongminchoob

Use this calendarHeight={335}

I hope it solves your Problem.

All 5 comments

Changing the calendar height doesn't trigger a state change and so the calendar won't re-render.

If you want the calendar to re-render change something that actually sets the state on the calendar list.

Take a look at the component to see the props that trigger a re-render https://github.com/wix/react-native-calendars/blob/master/src/calendar-list/index.js

I do not want to re-render the calendar. I simply want to set the default height of the calendar. I am not using a calendarList. I am using a simple calendar.

HI @seongminchoob

Use this calendarHeight={335}

I hope it solves your Problem.

How can I change height of calendarList? I tried using calendarHeight but had to deal with calendar being cropped.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anishtr4 picture anishtr4  路  3Comments

microwin168 picture microwin168  路  4Comments

sonnguyenit picture sonnguyenit  路  3Comments

joaosauer picture joaosauer  路  4Comments

moiiiiit picture moiiiiit  路  4Comments