How I got to love React

Nearly an year ago I joined a React-driven SharePoint project in my spare time. I knew nothing about React. I have had previous experience with JavaScript, JQuery, Typescript and I have done some AngularJS and Angular tutorials.

As I started looking at the existing code-base in the project my frustration grew rapidly. At first it looked like a giant mess of XML-like markup along with JavaScript/ Typescript.

In order to understand the concept and at least find out what was happening I started following along the quite obvious path:

  1. Official React tutorial  – great resource to quickly get up-and-running with React
  2. State vs Props – one of the most confusing topic initially. There are tons of resources on the net, but I found this StackOverflow topic to address the question in a clear and precise way
  3. Redux is a state container commonly used with React. There are quite a lot of options and opinions in regards to state management solutions out there

Now, after having about 10 months of React experience I am kind of appreciating the whole development experience.

So far I really love how:

  • React is taking care for re-rendering only the necessary parts of your DOM. Through React’s memory reconciliation algorithm, the library constructs a representation of the page in a virtual memory, where it performs the necessary updates before rendering the final web-page into the browser.
  • Reusing React components is easy and straightforward. Looks like React is build with that concept in mind
  • It was so easy to get information and support. React is now one of the most popular JavaScript UI libraries in the world. It has over 70K stars on GitHub, over 1100 contributors, over 6M downloads this past month alone, and well over 4K company stacks

Looking now at Angular and Vue I am pretty sure that they are also great tools to get the job done, it just so happened that I fell into the React’s world and my plan is to stick around a bit more…

SharePoint’s weird column names

It is a well-known fact that SharePoint encodes special symbols in column names for it’s internal use. For example all the spaces are replaced with _x0020_

However on some occasions even a valid letters in the beginning of the name are encoded. For example: “Col1” becomes “_x0043_ol1”. It was pointed in a online discussion that if the column name resembles the Excel’s “A1 notation”, it get’s encoded.

The issue that I was experiencing was exactly with the example above. If I tried to use the internal name in a REST query it ended up with an error. The possible values that I tried were: “Col1”, “_x0043_ol1” or “%5Fx0043%5Fol1” all with the same result – error 400.

Solution was to query all items of the list and extract the name of the column from the response. To my surprise the column in question was encoded as “OData__x0043_ol1“.  Using this name started to get me the correct responses from the REST query. This one was pointed out to me in a Stack Overflow question.

Hello world!

Well, this blog was started as a personal development goal. The plan is to maintain a log of my thoughts and insights on software development. Let’s see if and how it will evolve…