Love Coding – programming blog
Joanna
React Hooks – useReducer hook example
UseReducer is an alternative to useState. It works better when you have complex state logic that involves multiple sub-values (e.g. if your state is multidimensional object) or when the next state depends on the previous one. UseReducer hook accepts a reducer of type (state, action) => newState, and returns the current state paired with a dispatch method:
Read more
Joanna
React Hooks – useState hook example
Hooks are a new functionality of React, thanks to which we can “hook into” React features, which makes writing applications easier. First hook that I want to show you is called useState and it is a hook that allows you to use state in a functional component (before hooks you could not use states in […]
Read more
Joanna
CSS text-decoration property and new styles 2019
New styles, tags, functionalities – this is what tiggers like best 🙂 In this post I will show you how to style text using the text-decoration tag and what new styles for lines (underlines, overlines) are available from 2019
Read more
Joanna
Styling chosen links on site, e.g only links to PDF file
In previous post: styling lists with pseudo-classes I described how to change the color of active, clicked or hovered links. Now I will show you how to change the style of selected links, e.g. only those that lead to PDF files.
Read more
Joanna
Styling links with css
Standard appearance of hyperlinks on a website depends on the browser. Each browser can display links and their variants (with different pseudo-classes) in a different way. Usually we want to set our own styles so to display links in the same way in any browser. Links can have different states, and each of this states […]
Read more
Joanna
Basic git commands
You can perform git commands for example in: – cmd console (widnows start -> cmd. It should oppened Command Prompt app. To go to the root directory, enter cd \ . Next enter cd + path to directory with your project, e.g. cd Users\ Joanna\Desktop\my-project – git bash console, which you can get from https://git-scm.com/downloads […]
Read more
Joanna
Rem, em – length units in CSS
I must admit that I rarely used such units of length as rem and em so far. I usually used pixels (px), because somehow it was easier for me to associate what size a given element will have. The rem and em units, however, have one advantage over pixels – they can be set in […]
Read more
Joanna
Responsive images in HTML5, using srcset
Images often are problematic while we creating web page . Displaying larger image on larger screen is a better for user experience, but displaying large photo on small screen, e.g. on a phone, may unnecessarily delay page loading. Therefore, a good solution is to “serve” images with different sizes and weight for different screens.
Read more
Joanna
Auto resize image to div size
Sometimes we want that picture on page shrinks when browser window shrins. This can be easily achieved by using a short css entry.
Read more
Joanna
What is hoisting in javascript?
Every junior front-end developer should know what hoisting is. This issue can be easily understood, so if you have not heard of it before, you can quickly catch up:
Read more