{"id":15,"date":"2023-02-10T06:50:00","date_gmt":"2023-02-10T06:50:00","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/omargarzacantu\/?p=15"},"modified":"2023-02-10T06:50:00","modified_gmt":"2023-02-10T06:50:00","slug":"bye-node-hello-react","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/omargarzacantu\/2023\/02\/10\/bye-node-hello-react\/","title":{"rendered":"Bye Node, Hello React!"},"content":{"rendered":"\n<p>As I mentioned in my previous blog post, this past week I was able to get the most current Craft Center project. The backend was for the most part working as expected, but the front-end was missing functionality. Our team therefore decided that fixing up the front-end was the best move to make. However although I was used to web development with Node.js, I wasn&#8217;t part of the class that experienced web development with React. Honestly, I felt a bit overwhelmed, but I remember that I had bought a Udemy course at the advice of a team member back when I took the database class. <\/p>\n\n\n\n<p>I remembered that it covered the most popular frameworks and render engines, so I went back to take a look at it. As I skimmed across the videos I noticed the React one. It was incredibly helpful, especially considering that much of the content had been updated for 2023. I learned about components and how the React framework is designed to be modular, so that only the individual parts of a website that are updated need to be rendered. Not only does this make the operation of a website faster, it simplifies the project file structure. Websites can now be layered with different components each adding functionality to the website without having to understand long pages of codes. <\/p>\n\n\n\n<p>This tutorial was invaluable as I had run across classes, like the one shown below, and I wasn&#8217;t sure what is was meant to do. <\/p>\n\n\n\n<p class=\"has-tiny-font-size\">export default class AddClassForm extends Component {<\/p>\n\n\n\n<p class=\"has-tiny-font-size\">&nbsp; &nbsp; constructor(<em>props<\/em>){<\/p>\n\n\n\n<p class=\"has-tiny-font-size\">&nbsp; &nbsp; &nbsp; &nbsp; <em>super<\/em>(<em>props<\/em>);<\/p>\n\n\n\n<p class=\"has-tiny-font-size\">&nbsp; &nbsp; &nbsp; &nbsp; <em>this<\/em>.handleSubmit = <em>this<\/em>.handleSubmit.bind(<em>this<\/em>);<\/p>\n\n\n\n<p>&nbsp; &nbsp; }<\/p>\n\n\n\n<p>With the course I realized that this was the original way of using components, which had now been supplanted by hooks for React. Hooks are created by using useState() from React to hold a variable\/object or functions which act on user changes. Additionally the individual component can be exported with a single line at the end of the file:<\/p>\n\n\n\n<p class=\"has-tiny-font-size\">export default componentName;<\/p>\n\n\n\n<p>Luckily for developers and myself, these new changes are compatible with the old class system so as I move to fix and add functionality, I won&#8217;t have to rewrite old code that works. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>PS: If you want to know the tutorial I&#8217;m using look for: <a href=\"https:\/\/www.udemy.com\/course\/the-complete-web-development-bootcamp\/\">The Complete 2023 Web Development Bootcamp<\/a> by Angela Yu.<\/p>\n\n\n\n<p>Hope this Helps!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I mentioned in my previous blog post, this past week I was able to get the most current Craft Center project. The backend was for the most part working as expected, but the front-end was missing functionality. Our team therefore decided that fixing up the front-end was the best move to make. However although [&hellip;]<\/p>\n","protected":false},"author":13157,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/omargarzacantu\/wp-json\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/omargarzacantu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/omargarzacantu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/omargarzacantu\/wp-json\/wp\/v2\/users\/13157"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/omargarzacantu\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":2,"href":"https:\/\/blogs.oregonstate.edu\/omargarzacantu\/wp-json\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":17,"href":"https:\/\/blogs.oregonstate.edu\/omargarzacantu\/wp-json\/wp\/v2\/posts\/15\/revisions\/17"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/omargarzacantu\/wp-json\/wp\/v2\/media?parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/omargarzacantu\/wp-json\/wp\/v2\/categories?post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/omargarzacantu\/wp-json\/wp\/v2\/tags?post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}