stephy / CalendarPicker

CalendarPicker Component for React Native
803 stars 373 forks source link

Style Invariant Violation #204

Closed ofir94 closed 4 years ago

ofir94 commented 4 years ago

I am having this problem with the component after the last update.

Invariant Violation: [10193,"RCTText",1,{"marginBottom":"<>","fontSize":"<>","width":"<>","textAlign":"left","accessible":true,"allowFontScaling":true,"ellipsizeMode":"tail"}] is not usable as a native method argument.

CapturaErrorCalendar

Do you know how to fix it ??

peacechen commented 4 years ago

It looks like makeStyles() is computing NaN for the scaled values. Are you passing in width,height or scaleFactor props?

Please post your <CalendarStrip> usage to help debug this.

ofir94 commented 4 years ago

Hi, thanks for the help.

No, I'm not passing any of width,height or scaleFactor props.

This is how I am using the component:

<CalendarPicker startFromMonday={true} minDate={minDate} maxDate={maxDate} weekdays={['Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab', 'Dom']} months={['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre']} previousTitle="Anterior" nextTitle="Próximo" onDateChange={onDateChange} onMonthChange={onMonthChange} selectedDayColor={Colors.blue} selectedDayTextColor={Colors.white} customDatesStyles={customDatesStyles}
/>

peacechen commented 4 years ago

I placed your code into the example project, making the appropriate adjustments for methods and variables, and it runs ok. Try running the example project with your code.

Try passing width & height props to CalendarPicker in your code. By default it gets the screen dimensions: https://github.com/stephy/CalendarPicker/blob/master/CalendarPicker/index.js#L155

peacechen commented 4 years ago

Closing due to inactivity. Feel free to re-open if you have information to add.