Posts

Showing posts with the label Develpoment

Why The Hell Would I Use Node.js?

Image
JavaScript’s rising popularity has brought with it a lot of changes, and the face of web development today is dramatically different. The things that we can do on the web nowadays with JavaScript running on the server, as well as in the browser, were hard to imagine just several years ago, or were encapsulated within sandboxed environments like Flash or Java Applets. Before digging into  Node.js solutions , you might want to read up on the benefits of using  JavaScript across the stack  which unifies the language and data format (JSON), allowing you to optimally reuse developer resources. As this is more a benefit of JavaScript than Node.js specifically, we won’t discuss it much here. But it’s a key advantage to incorporating Node in your stack. As Wikipedia states: “Node.js is a packaged compilation of Google’s V8 JavaScript engine, the libuv platform abstraction layer, and a core library, which is itself primarily written in JavaScript.” Beyond that, it’s worth noting t...

Understanding React and ReactDOM

Image
The first line — import React from 'react'; - brings in the React module from your React library. It also creates an Object called React which you can tap into pre-written methods. For example, createElement() is a method that belongs in the React object. createElement() is also how React renders things into HTML. When you're using JSX, JSX compiles and transforms your code into a React.createElement() call. Note: You can write React ‘code’ without JSX, but it means that you will need to format everything to fit with createElement() method requirements. The next line after import React from 'react'; is import ReactDOM from 'react-dom';. This line imports methods that are available from react-dom and makes it accessible through the Object named ReactDOM. When you are rendering your React component, you are doing it via ReactDOM. Note: the DOM is not something that is new or exclusive to React. It is part of HTML and lets you hook into different parts of ...