Comments (4)
I don't feel strongly about this one. If you want to submit a PR, I'll look it over. Probably won't do anything myself for this though.
from react-resizable-panels.
The PR you submitted is an improvement (thanks!) although I'm wondering about the distinction between HTMLAttributes
and AllHTMLAttributes
. It looks like some attributes (like value
for HTMLDivElement
) are excluded from HTMLAttributes
whereas others (like defaultValue
) are included. AllHTMLAttributes
includes both, but I'm not sure how to refine it based on the specified tag name.
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAJQKYEMDGMA0cDecCCANoQBIAqAsgDL4wxTABGArjEgM7bnW31OsdsaKKjYBRQkhBIAdvAC+cAGZQIIOACIR6GBoDcAKAMwAnmCRxuVMigDmAORTS4AXjgBrJCYhLLlKhJSsjA2Dk5IFChghgZKzDIYwBAycABCqigAJgDCapAywQA8oY7OSAAebDKZ7H7UJeEAfAAUOAZwcDB2pUiY7XAAdEMi7DAG8gBcBMRWvAwsbOzF3U1wAGS4-V1h0lMN0uMAlJsdIjDMUCnCokiB0nLN2z3YIzCHhvJGcQkwSSmOUFUAHdcuBkkV9hYKlUanVrCtpC02h0nuE+h0hgNXuMprM6PMBEtIY11idOgikHsKUcyWcLldtOJJPcYI8KS8OG8PkZkXBCukIFlQflguSdkgXBpgDIwKwNJ1gDBJJLFro4AA3FCEZgSnAARgATABmRQAeka4wMvMKAOBwvBcjFPUl0tlat+SolGlV8s12t1hpNcHNlqt-VNprgAAEYOwALQVcwYBOA6D9fkZHJ5B3wVHSSWZYDq+Ue5Xezm+rU6lz641mi2fMMdCPR2MJ8pJmAp1RQdO2iAg7MFR15r2F4sKz0qisaqsBuvBhsGIA
Maybe this is a limitation of TypeScript or maybe just a gap in my knowledge. Going to poke at it some more before making a release.
It looks like ComponentPropsWithoutRef
might be a better option.
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAJQKYEMDGMA0cDecCCANoQBIAqAsgDL4wxTABGArjEgM7bnW31OsdsAYQjgIAOyTiYABSgQw7AOrAYACwitkAM2xooqNgFFCSEFPgBfONvkg4AIgPoYDgNwAoDzACeYJHDcVGQoAOYAcijmcAC8cADWSD4Q2oGUVCZmFiERUUgUKGCeHtrM4hjAEnAiYpLSADw5kdFIAB5s4gAm7GnUTXkAfAAUOB5wcDBhzUiYY3AAdIsG7DAelgBc1aKQdbLyiirqmjA6jVODcABkuHOTueab-eZrAJQ34wYwzFDicPqGSEy5mkQzu02wyxgL08li8o3G9RqOwsE3O5hiDmA4jArAcE1UpgxbBWeIAbihCMwkDEcABGABMAGZrAB6AZrDzwuAsllwAACMHYAFo2v4MCKoPIoHNEdsJCiwXkMZ1gKS8TACdSHMTXHByZTqXSmaz2bCgA
I'm running into a roadblock when it comes to forwardRef
next though. Not sure how to pass along the generic type.
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAJQKYEMDGMA0cDecDCE4EAdkiTAApQRgDOA6sDABYQCuMyAZtmlKhhIAogBskIcljjdoAdxRQAJjzgBfGTRBwARAPQwdAbgBQJmAE8wSOAAkAKgFkAMvZQBzAHIpJcALxwANZIFhDcdk7OYhJSbl4+SI4oYKYm3OwkGMCkBESQZBQAPHHevkgAHkIkSnQRLiUJAHwAFDgmcHAwHqVImO1wAHRDAnQwJmoAXLnEBVQ09EysHFxI3MXdTXAAZLj9XfGSUw2S4wCUux0CMOxQJHD8giLikhTN+z3YIzCnpmpmAPT-OCeCDwOg3GxsOSdCAyeSKJSdFg2dzkJBQYBoTpWJAmNCkUbTfJSRYsABiEAUyiQKlW-jhUCptO4zUIMykPzMbQ6hTZxIopIpTJpqneCT8OmAJDAnB0nWY4glQlGcoAbihROwkH4cABGABMAGYNP9GuMTNy4IC4AABGB0AC0FWsGCdUBoUH6vLypBJzHJlIRIrpYskEqUwFVcpgCu1OmVhjg6s12r1RpNZr+QA
from react-resizable-panels.
Maybe this is not worth the effort and I should just stick with the incremental improvement of your change.
Published [email protected]
from react-resizable-panels.
I played around a bit but it's beyond me. If a user needs this degree of type safety they will have a good puzzle.
Thanks for the review and extra investigation.
from react-resizable-panels.
Related Issues (20)
- Collapsed state resets when new values are provided to collapsedSize/minSize HOT 4
- Version 2.0.0 onClick regression HOT 1
- [Enhancement] Support CSS values for defaultSize, maxSize & minSize HOT 1
- onDragging not working HOT 2
- Issue with conditionally rendered Panels HOT 4
- Example for fixing SSR flicker in NextJS page router HOT 7
- How to change minimum size to collapse the panel HOT 4
- [Example]: Conditional and Collapsible Panels HOT 11
- Can I use conditional rendering with imperative group panel API? HOT 4
- feature request: typed external storage API HOT 1
- onDragging to much calls HOT 3
- Z Index issues HOT 3
- panel seems to get clipped when dragging up HOT 6
- Resizing panel doesn't set the new resize state until clicking on the resize handle (v2.0.0+) HOT 3
- UseLayoutEffect on PanelResizeHandle.ts (SSR) HOT 2
- Tiny layout shift (SSR) HOT 1
- Drag gets priority over overlapping elements HOT 7
- data-panel-size did not match. Server: "null" Client: number HOT 12
- Error: "Failed to execute 'getComputedStyle' on 'Window'" HOT 3
- [Enhancement] Provide "null" storage to avoid persistence in localstorage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-resizable-panels.