I’ve always found knowledge to be a bit like cheese. Cheese with holes, like you see on Tom and Jerry. I’ve been studying React on Udemy. It’s interesting, but I’m not going to remember it all. My plan is to keep using it after this course, to keep referring back to my brain and my notes when I need something and I was outside smoking in the pitch black of the outside and I started to wonder if it was worth all this time. After all you can just look things up as you go.
The truth is, at least I hope it’s the truth, that I like to have large chunks of knowledge embedded into my subconscious. I know the concepts will remain in my mind even if I need a little help getting them out and I think that’s confidence booster. The other horrible truth is that I’d rather work with animals.
Knowledge for me, even in short term situations, is like cheese. Much to the annoyance of people I’ve worked with. During a conversation where they might explain something technical I cannot receive anything but cheese. Covered in holes. It takes me time to process what’s been said, sometimes overnight I’ll go “Ohhhh!” in a moment of understanding.
As I sit here now and feel like I can’t tell you how any of what I’ve been studying works for the past forty five hours of studying, I worry that it was wasted time. Because I’ve an ability to endure which is why I don’t do what I want in my life. I feel like if I can just get through this or that, the benefits will be there. The rewards. They never are though. Partly because of the conversations at work being cheese with holes in. I just can’t remember a damn thing and one of the few things in this life that make me smile are cats and dogs.
I don’t want to have to move back in with the family, although still scared of the virus my Mum and her husband are basically still hiding indoors. Which seems fair because you don’t want to get long covid, but I worry about them as people. I think maybe it’s time I worried more about myself. Not in the ways that I think I probably come across as doing, not in the self-centred ways. But real action for my life. My episodes have held me back terribly.
I’m nearly forty. That just doesn’t look or sound right. I’m told I don’t look it which I like, but God knows I don’t feel it. People have families and buy a home by now. I might never have the typical family, maybe I feel too young and maybe I’ll always feel too young, to have one anyway, but I do think I should move on somehow. But how if you can’t get work, or if you can get work but worry it won’t last? I know the answer. I could freelance in something that I’d quite like to escape. It’s a start. But it’s also not going to rope in enough money to keep me going for some considerable time.
The knowledge from my course? Maybe I’ll write a shitload here for my benefit if not for yours.
React is a component based framework grouping together chunks of HTML into single pieces. A component can be thought of a function call, and is actually a function, though you can also create class based components if you so with.
Into a component you can pass props. Props allow you to pass variables into your components both primitive types as well as arrays and objects, in order to be able to configure them. You can also pass in functions meaning that if you have a hierarchy of components and two sibling components need the same data, you can define a function in the parent component which you pass to sibling a, sibling a can call the function, passing some data back if need be, the parent can act and the props passed to sibling b will change. So that’s how you can do sibling to sibling communication.
You can also use a global state management system. We were shown three alternatives; a) the context api. Not good for things that might change frequently, but easy to understand and use. b) Redux. I feel a bit lost talking about Redux now. Where did my knowledge go? I suppose it will return. c) He showed us a custom hook, which is a function which will add functionality to other functional components, which could be used as a way of managing global state. I think I’ll stick to redux.
I’ve also covered TypeScript, a way to add type safety to your coding. I’ve covered animations. That will take some learning.
The built in hooks: useState allows you to manage state. It returns an array of two elements the first is the state that you want react to manage, like a variable, maybe items, and then a state updating function, conventionally that would be called setItems. The cool thing about changing state is that you can use the state inside your component but when you update that state the component will rerender.
Technically I’ll finish the course tomorrow but there are a couple of revision modules I think would be worth doing. I should be finished in a couple of weeks. I’ve got more and more tired of watching these videos, but hopefully it’ll be worth it?
I do need some work though. I need to make some money…