daniel-lundin / react-dom-confetti

Trigger confetti explosions on state transitions
624 stars 30 forks source link

width and height not working (typescript) #29

Closed codingyourlife closed 4 years ago

codingyourlife commented 4 years ago

The example shows width and height as string: https://daniel-lundin.github.io/react-dom-confetti/

But node_modules/react-dom-confetti/index.d.ts shows:

interface ConfettiConfig {
    angle?: number;
    spread?: number;
    width?: number; //number not string
    height?: number; //number not string
    duration?: number;
    dragFriction?: number;
    stagger?: number;
    startVelocity?: number;
    elementCount?: number;
    decay?: number;
    colors?: string[];
    random?: () => number;
}

width and height as number or empty. It also doesn't work when I pass in:

const confettiConfig: ConfettiConfig = {
    angle,
    width: 20,
    height: 20
}
sepehr500 commented 4 years ago

I have the same issue

Nautman commented 4 years ago

I also have this issue. Does @daniel-lundin need help with a pull request?

daniel-lundin commented 4 years ago

I just merged a PR with a fix for the typescript definition. Will do release later today. Thanks for the patience

Nautman commented 4 years ago

Great thanks, @daniel-lundin! Much appreciated for the hasty work :)

daniel-lundin commented 4 years ago

0.1.4 is now released which should fix this.