[WP] 21.03.2023 part3 | polymorphism

fig 1.1 polymorphism-example 

 -----------------------------------------------------------------------

In the next paragraph Id like to make a note about polymorphism in React. geekr polys – many and geek morfe – shape. It is a strategy/paradigm which assume components to be designed in a way that allows to use different html tags. Each html tag holds its specific semantics and it is important to use apropriate tags for intended purpose. It is necessary from SEO and acessibility – a11y/screen readers point of view. Lets look at an example. Navbar usually contain buttons and links which look exactly same. In html semantic rules button is an element which triggers a script/function when pressed. On the other hand a link or an anchor tag is a piece of text which onClick navigates the user to the whole new html page with adress specified in href attribute of anchor tag.

Over-and-out

g-marcin

Komentarze

Popularne posty z tego bloga

[WP] 23.06.2023 | subjects

15.07.2024 | simplicity

[WP] 05.06.2023 | angular-intro