Thanks to visit codestin.com
Credit goes to github.com

Skip to content

typing error in React #2960

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

Open
chungwong opened this issue Feb 24, 2025 · 4 comments
Open

typing error in React #2960

chungwong opened this issue Feb 24, 2025 · 4 comments
Labels

Comments

@chungwong
Copy link

removeWidget takes type GridStackElement = string | HTMLElement | GridItemHTMLElement

public removeWidget(els: GridStackElement, removeDOM = true, triggerEvent = true): GridStack {..}

And the react version is violating the above

  removeWidget: (id: string) => void;

This triggered a chain of changes and there is on concern with one of the changes,

<GridStackWidgetContext.Provider key={id} value={{ widget: { id } }} />

Note key={id} here, id is GridStackElement which it could be a HTMLElement and I don't think it is ideal to pass HTMLElement as the key.

@adumesny
Copy link
Member

@Aysnine

@adumesny adumesny added the React label Feb 24, 2025
@Aysnine
Copy link
Contributor

Aysnine commented Feb 27, 2025

Thanks for the issue. this is indeed an issue, the react wrapper development is still ongoing, you can try the latest wrapper here in the interim. the latest wrapper doesn't use removeWidget(id) any more. And more streamlined and combinable

@adumesny
Copy link
Member

@Aysnine can you do your work/changes in our /react folder instead ? I know you have that review pending - we can always check it in an iterate. I just want all the work in gridstack and release an official wrapper that matches what I did for Angular.

@Aysnine
Copy link
Contributor

Aysnine commented Feb 28, 2025

@adumesny ok. I'm in the process of adapting setupDragIn, and the save/load example. when I'm done with these two I'll open the pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants