-
-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't have two TagInputs on screen #897
Comments
Having the same issue. Have a workaround for this been found? Or can it be fixed in a short amount of time? |
Found a solution! This would resolve the error @hannesgruber @biscoe916 Wrap your
index.js import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import { HTML5Backend } from "react-dnd-html5-backend";
import { DndProvider } from "react-dnd";
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<DndProvider backend={HTML5Backend} context={window}>
<App />
</DndProvider>
); then use this in your components import { WithOutContext as ReactTags } from "react-tag-input"; you'll probably don't need |
Encountered this bug today, this bug goes away when I remove <React.StrictMode>, but I am not sure if there are any side effect. I also tried wrapping App with DndProvider, but that doesn't make it work under StrictMode. |
If you attempt to have two tagInputs on the screen, you get an error saying one can't have two html5 backends.
I do not want drag and drop functionality, so if I specify drag and drop should be turned off, it really shouldn't use react-dnd for anything.
The text was updated successfully, but these errors were encountered: