T
T
tekkenot952021-05-10 10:31:53
Calendar
tekkenot95, 2021-05-10 10:31:53

Anyone familiar with the wix-react-native calendar?

In general, there is a library for calendars in react-native from wix :
https://github.com/wix/react-native-calendars

There is an opportunity to create a custom ( day component ) component for each number, for example, I created:

const currentDate = new Date().toISOString().slice(0, 10);
<Calendar
    markingType={'custom'}
    markedDates={{
        [currentDate]: {
            marked: true,
            dotColor: THEME.INDIGO_COLOR,
            customStyles: {text: {fontFamily: 'Inter-SemiBold'}}
        }
    }}
    dayComponent={(props) => (
        <DayComponent {...props} navigation={navigation}/>)} />


But the state transfer does not work, here is the main component itself, where I want to receive state and marking , as in principle it is written in the documentation:
https://github.com/wix/react-native-calendars#over...

60952fd7aae96249866510.png

So my day component looks like, where I want to show different variations of it depending on the state or marking that came in the props .

import React from 'react';
import PropTypes from 'prop-types';
import Today from "./Today";

const DayComponent = ({date, state, marking}, navigation) => {

    const onDayPress = date => {
        navigation.navigate("JobOffer", {date: date})
    };

    switch (marking) {
        case 'today': {
            return <Today date={date} onPressCallback={onDayPress}/>
        }
    }
}

DayComponent.propTypes = {
    date: PropTypes.any,
    state: PropTypes.any,
    marking: PropTypes.any,
    navigation: PropTypes.object,
}

export default React.memo(DayComponent)


But as a result, nothing comes up except date.
Therefore, I ask, maybe someone dealt with this calendar, and knows what could be the reason?

6095309857d1b497610971.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2021-05-13
@tekkenot95

did the support load them? if a paid package - load safely, they answer

K
Kirill Makarov, 2021-07-05
@kirbi1996

Faced with the fact that when you clicked on the day, it was not marked, I did marking there and in order for everything to work, I had to make a loader and re-render

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question