Reflections after building my very first app
Day one of the project started out with a code along from the lecture. Everything was easy, breezy and smooth, until I actually wrote any code. Error upon error, everything I installed was denied, dependencies that didn’t work and I was ready to give up before I even began. I must have deleted the Node_modules about seven times and checking the dependencies and package.json file about 100 times before I figured out the issue. Somehow an older version of SDK had sneaked in and messed everything up. About two hours well spent reading and testing but, for the future, I now know what to look for(and where). Lesson learned.
After getting everything to work from the lesson I began to work on my step tracker. Not knowing where to even start you do what any developer do, you google, and bam, there it was! The magical code that connects to the phone and counts the steps! You could say I was ecstatic after my wasted hours the day before. Only then to realize the code is written in the old way of React with classes and render(that I don’t fully understand, yet)…. Just my luck! Somehow I start rewriting and thanks to some Stack Overflow God I figured out how to rewrite it like I understand! Rockstar moment! The phone now counts my steps!!!!
Minor setback half way through the project when I was told certain CSS properties won’t work with Styled Components. While Styled Components are useful for React, they are not as useful in React-Native. Fine React-Native, I will change everything into StyleSheet and basically have the documentation up all the time so I don’t mess up the camelCase, the ’property values’ or add a px to the numbers. In the end, StyleSheet wasn’t that bad and it was actually fun to try it out and add it to my little React-Native toolbox. I actually like it better than Styled Components now, but sshhhh don’t tell anyone.
Towards the end of the week and after multiple failed attempts to send props between my components I decide to set up a Redux Store instead! This project is week four of the Redux journey and lets just say i’m no expert in everything that needs to be combined and created to make this work. But it turns out Redux solved all of my props issues I’ve had nightmares about the day before in about 30 minutes and like magic my app now has settings so you can change the daily step goals! Another rockstar moment for me where you hope it will work the way you want it to and suddenly it just does! I’ve had my doubts about Redux, and why use it when you have useState available, but lets just say I love it now.
After a lot of console.logs and googeling how to set a New Date by day (starting at 00.00 to 24.00) not just 24 hours from when the app was opened I think I’m ready to publish the project. I’m not gonna lie, at the beginning of the week I had doubts if I could even make an app or a step tracker for that matter but looking back now, after a week of React-Native, I’m not saying I’m an expert but guys, I made an app!!!