daniel-lundin / react-dom-confetti

Trigger confetti explosions on state transitions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

width and height not working (typescript)

codingyourlife opened this issue · comments

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
}

I have the same issue

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

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

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

0.1.4 is now released which should fix this.