LZLuca Zanzotterainpapidev.hashnode.dev·Feb 21, 2021 · 2 min readGIT: remove local untracked filesSometimes you just want to get rid of all the local untracked files. If you are sure of what you're doing (because there is no way to get back ! ) you can use git clean To check before , in a safe way, which files you're going to delete ---> -n ...00
LZLuca Zanzotterainpapidev.hashnode.dev·Nov 19, 2020 · 3 min readREACT : "custom validator" for String PropsProp-types is a library that allows to introduce some validation on the props we pass to React components. It works only in development mode , writing warning/errors in the console when a prop passed to a component is not valid, allowing us to disc...00
LZLuca Zanzotterainpapidev.hashnode.dev·Nov 17, 2020 · 2 min readREACT: children.map is not a functionI come across this error today in my Next.js app. When I found the solution I realized that I had already stumbled upon it not so long ago ... but I had forgotten. That's the reason why I'm writing this little post :-) This piece of code ... exp...00
LZLuca Zanzotterainpapidev.hashnode.dev·Nov 10, 2020 · 2 min readNEXT.js: Selector is not pureToday I stumbled upon this error in my Next.js application using CSS Modules Syntax error: Selector "img" is not pure (pure selectors must contain at least one local class or id) The reason was that , in one of my CSS modules ( that is a file like...00
LZLuca Zanzotterainpapidev.hashnode.dev·Oct 9, 2020 · 2 min readJAVASCRIPT: Check if an Object exists and is not emptyTo check if an object "myObj" exists ( it's neither null nor undefined) and it's not empty we can use this expression : myObj && Object.keys(myObj).length !== 0 && myObj.constructor === Object Explanation myObj if it evaluates to true, "myObj...00