kqito / use-tus

React hooks for resumable file uploads using tus
https://kqito.github.io/use-tus/?path=/story/usetus--basic
MIT License
104 stars 8 forks source link

Split `useTus` hooks function into two hooks #31

Closed kqito closed 2 years ago

kqito commented 2 years ago

Overview

This PR has some breaking changes.

Split useTus hooks function into two hooks

The functionality of the conventional useTus hooks has been split into two hooks.

The previous useTus hooks was dependent on the TusClientProvider and could only be used if the Context was specified as the parent component.

I believe that there are use cases where you want to simply use tus without using Context for file uploading using Tus in React.

Therefore, I have changed the functionality of useTus hooks so that it does not depend on Context. Conversely, useTusStore hooks can be used for use cases where you want to manage tus stores using context.