2019-03-27: Book Report

Words
497
Reading
3 min
Listen
Play
7y

Hello folks, I am continuing to read Learning Web Development with React and Bootstrap.

Chapter 4

One of the things that I do not like about React is how complicated it is to make a web form. If you want to do data binding with props; then you need to set up a system to let new values to mutate the current form prop values. For instance, if you want to set a prop to be the value of an <input value={ this.props.foo } /> field then that input field is read only.

In order for that form input to take in any value, you will need to set a function for its onChange event. <input value={ this.props.foo } onChange={ changeFoo() } />. Then you need to make sure that you mutate the state to take in the new values.

When it comes to state and regular variables; I still have a hard time understanding when I should be using state and when just regular variables is good enough. I hear that you should not be using the state so much, but lot of instructional materials including this book fails to demonstrate or explain why you should not use the state so much. Right now, I do use the state often when sending data from a view controller to its child components, and it sends the data back from events, and it works fine.

Chapter 5

Most of this chapter is learning about Bootstrap features with some insight of React component life cycles. They did briefly went over most of the life cycles, though I think some are deprecated right now since the book may had been written from an older version of React where using React.createClass() was one of the methods to creating components.

Otherwise, this chapter only went into details about the Alert and Modal Bootstrap components. The Alert component is a way to display messages about an event; like a success message after submitting data from a form, or to tell the user something went wrong. There are semantic classes that you can use to adjust the look of these alerts to suit the message you want to display. Modals are like window popups that darken the web page “underneath” it, but the time I made these modals from previous projects it was a chore to make them with all of the <div>’s that you need to make, and the classes to go with it.

Overview

Regardless with some of the book’s shortcomings, I still enjoy reading this when I get the chance. Both of these chapters were short, but I can understand the material it presents. Granted, I picked this book to learn about React, not so much Bootstrap as I had used Bootstrap in the past.

Even when I was reading the Vue book prior to this one; I still felt a little lost especially with the Vuex chapters. Speaking of state management; that is going to be the next chapter with this book as it talks about Redux.

2019-03-27: Book Report | Ecency