-
Notifications
You must be signed in to change notification settings - Fork 0
/
probs.txt
24 lines (18 loc) · 1.5 KB
/
probs.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
problem & solutions:
1. zero dependencies - bc i did wanted to learn how stuff coded behind the scene, no lib was used (except core lib's),
it was time consuming and completly worth it.
sol: a lot of guides, stackoverflow and chatting with good friends (google & chatGPT) also real humans, I've manage to
overcome and build everything i wanted (the most difficult one was the svg d&d)
2. performence - bc their is a complex layout, grain animation + floating svg's + d&d, every setState can ruin/restart everything
sol: used correct folder structure so state wont update unrelevant components (based on React Fiber),
used useRef (react dont like it however sometimes its the better fit),
used localStorage for state managment, prefered that option over redux or useContext because it wont trigger unneeded render
important! for the performance i used quite a lot eventlisners instead of useState, this way i change only what i need
3. imgs - imgs was a bit of a struggle in this project, from quality, to copyrights and width & heights of the original asset
sol: learned how to use inkscape to cut dynamic sizes, and deal with imgs converstions (online converstion did not worked out)
4. svgs - all the floating svgs were hard to find, and than implement as the original version is jpg
sol: learned how to convert img to bitmap than to svg
5. scrolling - needed to do it alone (rephrase this),
sol: in a hook, i used the observer design pattern
learend:
- react does not work well when needed to update a lot like mouse movment