I am using React-Flickity component and in mobile it works fine and in desktop it doesn't work and destroy not triggering
And one more isssue is not able to set the maximum height of a cell across all other cells
import React, { Fragment, Component } from "react"
import classNames from "classnames"
import PropTypes from "prop-types"
import Flickity from 'react-flickity-component'
//import GenericCarousal from "../Carousel/Carousel"
import { getCard, getHeading, getRichText } from "../../helpers/uiHelper"
import ProductCarouselCard from "../CardType/ProductCarouselCard"
import AthleteCard from "../CardType/AthleteCard"
import CarouselSetting from "./CarouselSetting"
import "flickity/css/flickity.css";
import cstyles from "../BrandCarousel/Carousel-tw-styles"
import { getImageUrl, getSrcSet } from "../../adapters/cloudinary.adapters"
I am using React-Flickity component and in mobile it works fine and in desktop it doesn't work and destroy not triggering And one more isssue is not able to set the maximum height of a cell across all other cells
import React, { Fragment, Component } from "react" import classNames from "classnames" import PropTypes from "prop-types" import Flickity from 'react-flickity-component'
//import GenericCarousal from "../Carousel/Carousel" import { getCard, getHeading, getRichText } from "../../helpers/uiHelper" import ProductCarouselCard from "../CardType/ProductCarouselCard" import AthleteCard from "../CardType/AthleteCard" import CarouselSetting from "./CarouselSetting"
import "flickity/css/flickity.css";
import cstyles from "../BrandCarousel/Carousel-tw-styles" import { getImageUrl, getSrcSet } from "../../adapters/cloudinary.adapters"
class Carousel extends Component { constructor(props) { super(props) this.state = { swiping: false } }
flkty = null; componentDidMount (){ const resize = this.flkty.resize this.flkty.resize = () => { this.flkty.element.classList.remove('flickity-resize') resize.call(this.flkty) this.flkty.element.classList.add('flickity-resize') } } componentDidUpdate() { if(this.flkty){ this.flkty.reloadCells() } }
}; render() { const { carousel } = this.props const flickityOptions = { cellAlign: 'left', pageDots: false, selectedAttraction: 0.01, friction: 0.2, arrowShape: false, // watchCSS: true, //setGallerySize: false, } const carouselStyle = carousel.styles && carousel.styles.trim()
} Carousel.propTypes = { carousel: PropTypes.oneOfType([PropTypes.object]).isRequired }
export default Carousel