React Components Explained – codeburst

  • Something like thisimport React from ‘react’;class MyComponent extends React.Component { render () { return div This is a component /div }}class MyOtherComponent extends React.Component { render () { return ( div MyComponent / /div ) }}This way you are able to compose more complex and useful user interface for your…
  • Component’s render method return JSX which then use to create real HTML output which will be rendered in the browser.The interesting Thing about render method is that it runs every time when your component State or Props updates.
  • Let me show you a exampleimport React from ‘react’;class MyComponent extends React.Component { constructor(props) { super(props); this.state = { name: “Manoj” }; } render () { return div My name is {this.state.name} /div }}// if we render this component the output will beMy name is ManojIgnore the super(props) (out of…
  • Let’s see an example.class MyComponent extends React.Component { constructor(props) { super(props); this.state = { name: “Manoj” }; this.changeName = this.changeName.bind(this); } changeName () { this.setState({ name: “Your Name” }); } render () { return div onClick={this.changeName} My name is {this.state.name} /div }}In the above code we are telling our React…
  • You can run this code on jsFiddle here.PropsVisualise props as options that can be passed to a component to customize its functionality.For example, I have a heading component which renders a heading with subtitle.class MyHeading extends React.Component { render () { return div h1This is a heading/h1 pSubtitle/p /div }}If…

The simplest library I ever used in my life is React. As you know React is based upon component design. Everything in React is a component which makes it easy to reuse components frequently. You can…
Continue reading “React Components Explained – codeburst”

Top 10 dev articles over the past week – JetRuby

  • Next week, we’ll be back with a new batch of brain food, specially selected to keep your heart healthy, brain fed and intellect tuned.
  • Have a great week!

Jingle bells, jingle bells, Jingle, in fact, all the way. That’s right, we love you beautiful bunch of literate people, so much, that we’ve handpicked a list of top 10 development-related articles…
Continue reading “Top 10 dev articles over the past week – JetRuby”

React State vs Props explained – codeburst

  • Let me define a React component a plain javascript function side by side.class DummyComponent extends React.Component { render () { return divHey/div }}const DummyFunction = () = console.log(‘Hey’)We defined a React component named DummyComponent and returned a div containing text Hey similarly, we defined a function named DummyFunction and output…
  • Let’s take a look at State.React Component StateA state in React Component is its own local state, the state cannot be accessed and modified outside the component and can only be used inside the component which is very similar to, you already guessed it a function own local scope.
  • Let’s demonstrate this with an example.class DummyComponent extends React.Component { state = { name: ‘Manoj’ } render() { return divHello {this.state.name}/div; } }const DummyFunction = () = { let name = ‘Manoj’; console.log(`Hey ${name}`)}As you can see a component state can be compared to a function local scope.
  • Let’s take a look how we can use props in react.class DummyComponent extends React.Component { render() { return divHello {this.props.name}/div; } }// when using the componentDummyComponent name=”Manoj” /DummyComponent name=”Ajay” /We used one react component in multiple places here but with a different name.
  • Props, on the other hand,make components reusable by giving components the ability to receive data from the parent component in the form of props.We also get to know that React components are pretty similar to normal JS functions so from the next time keep this thing in mind 😉 .

Before jumping to state vs props we have to compare a React component with a javascript plain function. Let me define a React component & a plain javascript function side by side. We defined a React…
Continue reading “React State vs Props explained – codeburst”

How to Find the Next React.js Developer for Your Project

How to Find the Next React.js Developer for Your Project #reactjs #dev

  • Whether you’re looking to build an app that performs across multiple mobile devices with React Native, or simply want better performance for the front-end of your website, a React.js developer will be key to your project.
  • The web has matured over the past few decades, from a PHP back-end and static HTML pages for users to the interactive and dynamic experience it is today.
  • People expect fast front-ends and sleek user experiences; users will simply abandon a website if it’s anything but sleek and fast.
  • In 2013, Facebook released React, which allows developers to use server-side rendering (SSR) to build modern web apps.
  • A React.js developer is a type of front-end developer that is well versed in a specific set of skills and tools, including: – – The key to finding the right expert is to create a detailed project description.

Whether you’re looking to build an app with React Native, or simply the front-end of your website to perform better, a React.js developer will be key.
Continue reading “How to Find the Next React.js Developer for Your Project”

4. Four ways to style react components – codeburst

  • All depend on your personal preferences and the specific complexity of your application.If you want to add just a few style properties, then inline styling is the best option.When you want to reuse your style properties in the same file then style-component are perfect.When your application is more complex I…
  • Instead they are specified with an object whose key is the camelCased version of the style name, and whose value is the style’s value, usually a string.We can create a variable that stores style properties and then pass it to the element like style={nameOfvariable}We can also pass the styling directly…
  • CSS ModulesA CSS Module is a CSS file in which all class names and animation names are scoped locally by default.
  • Great article about css modules here.Similar to css we import css file import styles ‘.
  • Styled-components 💅Styled-components is a library for React and React Native that allows you to use component-level styles in your application that are written with a mixture of JavaScript and CSSFirst we need to install styled-components librarynpm install styled-components –saveNow we can create a variable by selecting a particular html element…

There are four different options to style React components. All depend on your personal preferences and the specific complexity of your application. In React, inline styles are not specified as a…
Continue reading “4. Four ways to style react components – codeburst”

Why Do Developers Now Compare Vue.js to JavaScript Giants Angular and React?

Why Do Developers Now Compare #VueJS To #JavaScript Giants #AngularJS And #ReactJS?

  • It was 2016 when Vue.js rose to fame and gained so much traction that it’s now seen as an alternative for even well established JavaScript libraries, such as Angular and React.
  • Since Angular belongs to search engine giant Google and React comes from social media behemoth Facebook, developers still trust and use those libraries more than Vue.js.
  • This blog attempts to shed light on why there is a growing belief among developers that Vue.js is set to become the top JavaScript library, leaving behind Angular and React.
  • The reason many developers are turning to Vue is that it addresses the issues of React and Angular.
  • But, one must not forget that Angular and React are still very big names in the JavaScript world, whereas Vue has just begun to rise.

Vue.js, an MIT-licensed open source project, is a JavaScript library for building web interfaces. The library was first released in 2013, but not many developers took cognizance of it in web framework technology for the next two years. It was 2016 wh
Continue reading “Why Do Developers Now Compare Vue.js to JavaScript Giants Angular and React?”

Why You Should Consider ReactJS for Your Web Application?

Why You Should Consider #ReactJS for Your #WebApplication? 

#IT #Techtalk

  • Yes, we are talking about ReactJS – the JavaScript library which is the hot favorite of developers and is climbing the popularity charts every day.
  • Managing system updates is very easy with ReactJS because every change does not necessarily affect each component in the system.
  • Developers using ReactJS have free access to a variety of useful applications and tools from the community at large.
  • Apart from these, there are numerous other examples such as Uber, Salesforce, KISSmetrics, Tesla, Scribd, Reddit, Periscope and many more which have leveraged the power of ReactJS to build world-class interactive web applications.
  • If you are looking to develop SEO-friendly, interactive web applications with great UI and expect your application to handle heavy traffic, it’s time to migrate to ReactJS.

According to the 2016 StackOverflow developer survey, React.Js’s popularity had recently increased by over 300%.What is making ReactJS so popular? Let’s take a look why you should consider ReactJS for your web application?
Continue reading “Why You Should Consider ReactJS for Your Web Application?”