Really great stuff here Kirupa. In 2 days I’ve gone from a total React NOOB to ready to tackle all the other tricky tutorials on the web and build out my first React app. Huge thank you!!!
You can just create a Header component, create the HTML/CSS that will define how the header looks (inside your render method usually), and just instantiate the component where you are constructing your entire page.
Loving the lessons! I’ve pre-ordered the next version of your book. I would personally name the callback processResponse rather than processRequest as I think it is clearer, but I’m being picky and others may not agree.
A bigger issue I have now hit. It seems to use a global xhr variable. My javascript is very rusty, but if I want to make it non global, is simply adding this. before all of them the way to go?
I could added it to the state, but presumably that would be silly as it would never be passed down.
Thanks, yes it did work. I think I put it in the componentdidmount method. Now reading various things about which is the better place to initialise things.