I scowled at the monitor, my eyes lit by backlight neon colours. I am supposed to be building a List component, but instead I was slumbered. Head in my arms, lost in thought…. and then I looked again at the code, and I saw daylight, for the first time in…
So many people go around today praying and believing in God but ask them if they believe in themselves they’ll have a million excuses lined up for why they don’t. If we’re good at one thing, it’s that we can worry ourselves to death. When we’re alone we worry we’ll…
Say you need to include a regular ol’
script tag in a template file based on a global variable being set or not. Well, here’s a snippett you can use.
This will add a script tag with a
src value that is produced by combining a value from
window.libName and combining it with
.min.js to create the proper path needed. After this is done, the script tag is loaded into the document using appendChild.
State machines are all the rage these days, and I think it’s for the better. I have seen several developers in the past few months or so really hammer home the idea of knowing all the states of your application before starting. They say to me, “Imagine it like this: you will know how your application will respond to anything, and everything because it will and can only respond in a way that you have determined. You are in charge of writing the state, and then writing the transitions between the states. A state will only exist if it can be safely transitioned to”. More, later.
Why would we use custom hooks? There are 2 reasons to use them:
Say you have React component that is a button, and when you click the button, it increases a number. So…
Sometimes, it feels like I like to remind myself why I use React, and that the answer should always be “to make my life easier.” React should simplify my life.
One of the things React does very well, right out of the box, is controlling HTML inputs. It turns bratty…