-
Notifications
You must be signed in to change notification settings - Fork 69
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
arrows don't re-render correctly #188
Comments
Hi! Thank you for the detailed issue. Can you try calling
|
I declared reference as below,
Then I got the below error So, I declared reference with null as below,
Then I got the error for "refreshScreen" function call Does we need to import anything for "refreshScreen" method? |
This is only a type error, I think it would work at runtime. To solve your error: // (note: this import does not look good indeed, it needs a fix on the lib's side)
import { ArcherContainerHandle } from 'react-archer/lib/ArcherContainer/ArcherContainer.types';
// ...
const archerRef = useRef<ArcherContainerHandle>(null); The method does exist, it's only your typing that is wrong 😉 |
In case one is searching, the example above is in general correct but your state var might changes earlier in the process causing undefined variable issues.
import { ArcherContainerHandle } from 'react-archer/lib/ArcherContainer/ArcherContainer.types';
useEffect(() => {
if (archerRef?.current) {
archerRef.current.refreshScreen()
}
}, [zoomLevel]); Checking for the availability of the ref might help. |
After initial rending the arrow lines appear correctly as shown below
After opened the accordion of some portion, arrow lines get collapsed and shown as like below,
Also, while scrolling, arrow lines get collapsed and shown as like below,
I saw that there is an instance method "refreshScreen" need to be call, when the onscroll event happening. But there is clear documentation regarding that method how to call it? So, could you please provide the working example for "refreshScreen" instance method
Another example
after initial rendering,
after opened the accordion,
let me know the working example that how to use instance method "refreshScreen" here.
The text was updated successfully, but these errors were encountered: