andnull` (when not using strictNullChecks):
If we use
strictNullChecks, the only values we cann asign are
When using variables that work with boolean, I like to name them something from which we can infer we are dealing with this type - like in this case, using the word
isLoggedIn (it can be yes ->
true or no ->
false). You can name them however you want, this is just a personal preference and I've seen quite a few people doing it. Try to store something different inside them, and again we get an error.
interfaces, I can make sure that the props I'm trying to pass to a component are the correct type, in this case, boolean.
Image source: Christina Morillo/ @divinetechygirl on Pexels