-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update when @container width changes #18
Comments
I fixed it, I'll create a PR with the proposed fix. |
I see that I can't, hence I'll post it here. Truncate.tsx
|
The following is if you want a debounce so it doesnt react directly.
I found 1ms prevented flashing in my case. However this might be entirely situational. |
I just finished a busy work and now I am follow up on your issue now. Thanks for your enthusiastic research. Here I have a simpler implementation. Please refer to whether it can meet your needs.
const [refreshKey, setRefreshKey] = useState(Date.now());
const onResize = () => setRefreshKey(Date.now()); This makes it easy to re-truncate by React's ability to re-render nodes when a key is updated. I added a little demo based on the official demo of react-resizable-panels, see: codesandbox |
Sometimes the container element is part of changes (eg: react-resizable-panels) without resizing the actual window. It'd be nice for it to update whenever this happens.
The text was updated successfully, but these errors were encountered: