pixijs / pixi-react

Write PIXI apps using React declarative style
https://pixijs.io/pixi-react/
MIT License
2.42k stars 180 forks source link

Bug: useAsset type requires a progress callback #502

Closed RJWadley closed 4 months ago

RJWadley commented 4 months ago

Current Behavior

with typescript: useAsset(url) throws a type error: Expected 2 arguments, but got 1

Expected Behavior

useAsset(url) is valid, and should produce no type errors

Steps to Reproduce

install pixi react at dev: npm install @pixi/react@dev create a new file with the following code:

// sample.ts
const asset = https://pixijs.com/assets/bunny.png
useAsset(asset)

run typescript checking on this file, you should see a type error

Environment

Possible Solution

onProgress should be optional: onProgress?: ProgressCallback

Additional Information

No response

github-actions[bot] commented 4 months ago

:tada: This issue has been resolved in version 8.0.0-beta.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: