yaodingyd / react-flickity-component

A React.js component for using @desandro's Flickity
314 stars 51 forks source link

Add fade functionality with flickity-fade #92

Closed JodiWarren closed 4 years ago

JodiWarren commented 4 years ago

I've basically just replaced flickity with flickity-fade. It's almost identical in size and allows for fade transitions.

yaodingyd commented 4 years ago

Thanks for your contribution!

However I don't think this is necessary and the right direction to go. To use fade you can just import flickity-fade package and specify that option. check example here:https://codesandbox.io/s/react-flickity-difcr

frazerf commented 4 years ago

Hi @yaodingyd I've implemented fade the same way you have above but I'm getting a lint error, as you are in your example, of import fade from "flickity-fade";

Is there anyway for this to be fixed?

yaodingyd commented 4 years ago

@frazerf just disable lint for this line

alexkerber commented 4 years ago

can this PR be fixed with the conflicts and merged? :)

joshiefishbein commented 4 years ago

Just to have this answered for people in the meantime, I followed @yaodingyd's advice when using react-flickity-component to get fade from flickity-fade working with typescript:

import Flickity from 'react-flickity-component';
import 'flickity-fade';

const Carousel = () => (
  <Flickity
    options={{
      // @ts-ignore
      fade: true
    }}
  >
    {/* slides... */}
  </Flickity>
);