Open hasin-zaman opened 2 weeks ago
Ohk i understood what kind of error you are facing in this , I've checked that . So I would like to try to solve this error and will let you know if i am able to solve this problem . Ohk @hasin-zaman?
Hey! @hasin-zaman I was trying to resolve this for very long but there wasn't any change . So I tried building it from scratch , and is working properly , but isn't similar the design you made . I am sharing you the video of how does it looks and If is looking as per your requirement tell me I'll do the PR . Let me know if any changes are required !
https://github.com/user-attachments/assets/e33fca66-5d47-4f61-ab86-0bfa430ea6a8
Hey this is pretty great @Govindggupta ! I'm leaving issue open though for now and I'm also gonna try to figure out the problem myself. We can then consider implementing a different component such as yours. Thanks for helping out!
Ohk @hasin-zaman I'll be waiting for you response and please let me also know what was the error , If you resolve it .
Hello there, I took a look at your code, and the problem is in the tabs.jsx file. When you change the prop of FadeInDiv tabs={propTabs}, the button works, but the animation of tabs doesn't. I couldn't solve it completely, but I hope this helps.
@KristijanVugrinec Thanks for identifying the problem. It helped a lot!
@Govindggupta So the issue was with tabs being used as state itself and so whenever component passed to one of the tabs changes state that change is detected in tabs too and tabs are rerendered. I partially solved the issue by isolating component from the tabs using React.createPortal. However, there is added overhead since we have to rerender component every time our component's tab is active.
In my /buttons/loading-button I am adding a new ComponentAndCodeTabs.jsx component that uses framer motion. Inside one of the tabs is loading button that uses a handleClick function to simulate loading. This loading button is working fine outside of ComponentAndCodeTabs.jsx component. Inside it either state change is not being detected or on state change component is rerendering unable to show any loading when button is clicked. Help required from someone who understands framer motion or frontend dev well!