uppy/packages/@uppy/react
Mikael Finstad 075636a3b3
remove react h (#5938)
it was added in #5935 but no explanation of why.

if you look at the build output of for example
`packages/@uppy/react/lib/headless/generated/Dropzone.js`:

```js
import { jsx as _jsx } from "react/jsx-runtime";
// This file was generated by build-components.mjs
// ANY EDITS WILL BE OVERWRITTEN!
import { Dropzone as PreactDropzone, } from '@uppy/components';
import { h as preactH, render as preactRender } from 'preact';
// biome-ignore lint/correctness/noUnusedImports: it's needed
import { createElement as h, useContext, useEffect, useRef } from 'react';
import { UppyContext } from '../UppyContextProvider.js';
export default function Dropzone(props) {
    const ref = useRef(null);
    const ctx = useContext(UppyContext);
    useEffect(() => {
        if (ref.current) {
            preactRender(preactH(PreactDropzone, {
                ...props,
                ctx,
            }), ref.current);
        }
    }, [ctx, props]);
    return _jsx("div", { ref: ref });
}
```

as can be seen there is no usage of `h`. `import { jsx as _jsx } from
"react/jsx-runtime";` is being injected for React JSX. see also
https://github.com/transloadit/uppy/pull/5896#issuecomment-3169210799
2025-08-29 16:24:16 +02:00
..
src remove react h (#5938) 2025-08-29 16:24:16 +02:00
.npmignore @uppy/react: refactor to TS (#5012) 2024-03-27 11:03:34 +01:00
CHANGELOG.md [ci] release (#5936) 2025-08-28 17:03:19 +02:00
LICENSE Move React components to @uppy/react package. 2018-06-18 10:14:08 +02:00
package.json [ci] release (#5936) 2025-08-28 17:03:19 +02:00
README.md Fix links (#5492) 2024-10-29 13:54:00 +01:00
tsconfig.build.json Merge @uppy/status-bar into @uppy/dashboard (#5825) 2025-08-05 13:17:29 +02:00
tsconfig.json Merge @uppy/status-bar into @uppy/dashboard (#5825) 2025-08-05 13:17:29 +02:00
turbo.json Fix turbo race condition (#5839) 2025-07-23 10:49:11 +02:00

@uppy/react

Uppy logo: a smiling puppy above a pink upwards arrow

npm version CI status for Uppy tests CI status for Companion tests CI status for browser tests

React component wrappers around Uppys officially maintained UI plugins.

Uppy is being developed by the folks at Transloadit, a versatile file encoding service.

Example

/** @jsx React */
import React from 'react'
import Uppy from '@uppy/core'
import { DashboardModal } from '@uppy/react'

const uppy = new Uppy()

class Example extends React.Component {
  state = { open: false }

  render() {
    const { open } = this.state
    return (
      <DashboardModal
        uppy={uppy}
        open={open}
        onRequestClose={this.handleClose}
      />
    )
  }
  // ..snip..
}

Installation

$ npm install @uppy/react

Alternatively, you can also use this plugin in a pre-built bundle from Transloadits CDN: Smart CDN. In that case Uppy will attach itself to the global window.Uppy object. See the main Uppy documentation for instructions.

Documentation

Documentation for this plugin can be found on the Uppy website.

License

The MIT License.