[WP] 07.02.2023 | dynamic url

 I recently learned new solution when passing pictures to some kind of component in react. If we have an Array with bunch of objects. One of the object properties represents img link. What is worth noticing is that all links are very similar to each other . If only number of picture is changing we can past full link into the component and dynamically change id number inside the string with template strings(„ and ${}).The array holding objects to present can include only id numbers of the pictures. To be honest it significantly reduce clutter in data structure(short part instead of full repetable link)Lets look at the example:

‚https://josh-bundler.com/img/avatars/004.png’ in this case only 004 is changing to 005 and so on…

`https://josh-bundler.com/img/avatars/${id}.png` simply put the link inside backtics and make a id dynamic with ${}.

Exploring new things

g-marcin


–Edit:


Exploring helper libraries of JS such as lodashdate-fnsvalidator.jsreact-number-format etc will be a great oportunity to see helpers in actions. Other name for helpers is utils.


–Edit:

Adobe Xd and figma are powerul tools to prepare views for user interfaces. It will be worthwhile to familiarize with them to become successful Front-End developer in the future. There is a free youtube playlist with Adobe Xd introduction.

Finally ive managed to install WP desktop application. There was some problems with authentication. I resolved all warnings within security section of my WP account icluding : two-step auth, recovery email and phone number, ssh key, two-step backup codes.


Recently i’ve pick up a bunch of tasks in colaborative web project called ‚pierwszyfront’. I need to reorganise color palette for light/dark themes and adjust site for small size screens.


Komentarze

Popularne posty z tego bloga

[WP] 23.06.2023 | subjects

15.07.2024 | simplicity

[WP] 05.06.2023 | angular-intro