anonn – 16-33 Oct 14
How can I access the styles of an element before it is rendered?
I have implemented a custom progress slider. Is there any way for me to access the width of the wrapper div in
initialSliderWidth
without needing to manually write it? Using refs doesn't work because the component hasn't rendered yet.8 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yeah exactly, I wanna access the initial width immediately...but Im not able to access the initial width until after it renders, so kinda unsure how to solve this issue
Was trying to implement my own progress slider to learn...and judging from how ugly the code is seems like ive got a lot to learn haha
thank you!!
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Ooh that's an interesting idea, so just absolutely position the circle to the edge of the rectangle bar thingo, then when you change the width of the rectangle bar, you change the circle location also!
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yeah im trying to implement it myself to learn
This thread hasn’t had any activity in 12 hours, so it’s now locked.
Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/902647189120118794/1030518633983651990