tweakpane / use-tweaks

🎛️ Tweak React components with Tweakpane
https://codesandbox.io/s/use-tweaks-example-58e02
MIT License
768 stars 23 forks source link

Return type error with useTweaks #43

Closed lourd closed 2 years ago

lourd commented 3 years ago

When using the useTweaks hook, I'm getting an error about the return types. The return type looks to be an object with a single key that is an empty string?

const {
    numCirclesPerGroup,
    circleGap,
    innerCircleRadius,
    numGroups,
  } = useTweaks({
    numCirclesPerGroup: { value: 12, min: 1, max: 40, step: 1 },
    circleGap: { value: 2, min: 0, max: 100, step: 1 },
    innerCircleRadius: { value: 20, min: 1, max: 100, step: 1 },
    numGroups: { value: 6, min: 2, max: 90, step: 1 },
  })
// Property 'innerCircleRadius' does not exist on type '{ "": { numCirclesPerGroup: ....

See this sandbox https://codesandbox.io/s/jovial-lamport-8c4u3?file=/src/App.tsx

unphased commented 3 years ago

Pretty sure now that if you revert your project to tweakpane 1.5.8 or earlier it goes away. I think i found out that the way to use codesandbox to verify this is to fork it, set the dependency versions and then reload the page. I get the error on 1.5.9, but not 1.5.8, 7, or 6.

cocopon commented 2 years ago

Fixed in 0.3.2-alpha.0.