Advanced React Component Patterns – kentcdodds

Advanced #ReactJS Component Patterns:  by @kentcdodds #JavaScript

  • Two of my courses will be (have now been) released as part of Egghead’s annual Christmas course release celebration 🎉 One is The Beginner’s Guide to ReactJS and the other is Advanced React Component Patterns.
  • 👀The course starts with a single lesson where I implement a simple toggle component that manages its own state.
  • My hope is that by doing things this way you can quickly identify the trade-offs of the different patterns and know when each pattern would be most appropriate.The course wraps up by refactoring the toggle component to a redux component affectionately called “Rendux.” I think that you’ll be blown away…
  • This way we can easily create custom components which have access to the toggle component’s on state and the toggle helper function.There are actually six lessons dedicated to Higher Order Components in this course.
  • Hopefully with this refactor you’ll see both the power and the simplicity of the render prop pattern.The basic idea of the pattern is that rather than have the toggle component be responsible for doing anything special in the render method, we delegate that responsibility over to the user and we…

An overview of some of the patterns covered in my recently released Egghead.io course (free until Friday). NOTE: This is a cross-post from my newsletter. I publish each email two weeks after it’s…
Continue reading “Advanced React Component Patterns – kentcdodds”

React.JS Top 10 Articles for the Past Month (v.Nov 2017)

React.JS Top 10 Articles for the Past Month (v.Nov 2017). 

@reactjs #JavaScript

  • React.JS Top 10 Articles for the Past Month (v.Nov 2017)Since more companies choose React.JS for their preferred web and app development, last month, ReactJS passed Angular for the first time in the number of jobs posted on StackOverflow the past month, we’ve ranked nearly 1,000 React articles to pick the Top…
  • Topics in this list: Inline Functions, Performance, Redux, Slack BrowserView, Debugging, Managing State, Migrating to React 16, Component Patterns, Kotlin, SketchReact.JS Previous Month: HereJavaScript, Vue, Node, Angular are posted separately: HereOpen source of the month is included at the end.Mybridge AI ranks articles based on the quality of content measured…
  • This is a competitive list and you’ll find the experience and techniques shared by the React leaders useful.React, Inline Functions, and Performance.
  • Courtesy of Ryan Florence, Author of React Router

For the past month, we’ve ranked nearly 1,000 React articles to pick the Top 10 stories that can help advance your career (1% chance).
Continue reading “React.JS Top 10 Articles for the Past Month (v.Nov 2017)”

#React Components – Zero To Hero Series – Part 2 by Vipul Jain cc @CsharpCorner #ReactJS

#React Components - Zero To Hero Series - Part 2 by Vipul Jain cc @CsharpCorner  #ReactJS

  • This is the second article in the ReactJS – Zero to Hero Series.
  • I recommend reading the first article (link given below), before going through this article.
  • In this article, we will see the explanation of React Components.
  • Components are the fundamental units of a React application.
  • Now, with this basic understanding, in the next articles, we will see more about Populating Props, Composing components, State, Default props and Validating props.

This is the second article in ReactJS – Zero to Hero Series. I will recommend you read the first article (link given below), before going through this article.
Continue reading “#React Components – Zero To Hero Series – Part 2 by Vipul Jain cc @CsharpCorner #ReactJS”

React Top 10 Articles For the Past Month (v.Oct 2017)

React Top 10 Articles For the Past Month (v.Oct 2017). @reactjs #JavaScript

  • React Top 10 Articles For the Past Month (v.Oct 2017)For the past month, we’ve ranked nearly 1,200 React articles to pick the Top 10 stories that can help advance your career.
  • (0.8% chance to be picked in the list)Topics in this list: Progressive Web App, Preact, Redux, Server Side Rendering, Structure, GraphQL, AWS, Component, AnimationOpen source of the month is included at the end.Top 10 for JavaScript, Node, Angular are posted separately in the publicationMybridge AI ranks articles based on the…
  • This is a competitive list and you’ll find the experience and techniques shared by the React leaders useful.A React And Preact Progressive Web App Performance Case Study: Treebo.

For the past month, we’ve ranked nearly 1,200 React articles to pick the Top 10 stories that can help advance your career. (0.8% chance to be picked in the list)
Continue reading “React Top 10 Articles For the Past Month (v.Oct 2017)”

Architecting a Squiggle – Birchbox Unboxed

Architecting a Squiggle  #react #components #css #reactjs

  • It looked like this, and was used to visually emphasize key words or numbers in a block of text.A SquiggleWith the assumption that this coral squiggle would be used only sporadically on a few key pages, we uploaded an image of the squiggle to our CDN and set it as…
  • Our new site, which was built in React, encouraged a component based approach.I created a Squiggle component (later renamed Highlight when it supported shapes other than squiggles) that wrapped any arbitrary content.
  • It accepted props for color, type, and alignment with respect to its content.Highlight type=’wave’ fill=’coral’ alignment=’right’ {title}/HighlightThe component used react-measure to listen to the height of if its children and record it in the component state.
  • ‘wave’ : ‘none’} fill=’coral’ alignment=’right’ {title}/HighlightAn example of conditional highlighting, made possible by the ‘none’ shapeRecently one of my teammates built support for Highlight in our custom Markdown component.
  • No developer time required!This tout was built by our web production team using only Markdown in the CMSWhy I Love itHighlight is one of my favorite components in the Birchbox repository because it makes highlighting text on our site as easy and therapeutically pleasing as highlighting text on a physical page.

When Birchbox rebranded in 2016, our new brand guide included a squiggle. It looked like this, and was used to visually emphasize key words or numbers in a block of text. With the assumption that…
Continue reading “Architecting a Squiggle – Birchbox Unboxed”

Writing Easily Testable Code with Stateless Components in React.js

Writing Easily Testable Code with Stateless Components in #React.JS  #javascript #testing

  • The use of Stateless Functional Components (a.k.a. “pure” or “dumb” components) in React.js continues to grow since first it was released in React 0.14, and for good reasons.
  • By relying on pure components, developers end up writing reusable code that’s extremely easy to test, which leads to better application architecture.
  • Personally, I like the term “pure component” because it’s indicative of what the code really is — a pure function sprinkled with some JSX.
  • In addition to these benefits, pure components also make it extremely easy to test code with any crazy props that you wish.
  • As we just saw, the code for functional components provides us awesome intel for everything we need to know in order to write effective tests.

Functional Stateless Components provides clean syntax that allows us to write more declarative code. We will look at stateless components and finish up with some unit tests in this article.
Continue reading “Writing Easily Testable Code with Stateless Components in React.js”

#React Components – Zero To Hero Series – Part 2 by Vipul Jain cc @CsharpCorner #ReactJS

#React Components - Zero To Hero Series - Part 2 by Vipul Jain cc @CsharpCorner  #ReactJS

  • This is the second article in the ReactJS – Zero to Hero Series.
  • I recommend reading the first article (link given below), before going through this article.
  • In this article, we will see the explanation of React Components.
  • Components are the fundamental units of a React application.
  • Now, with this basic understanding, in the next articles, we will see more about Populating Props, Composing components, State, Default props and Validating props.

This is the second article in ReactJS – Zero to Hero Series. I will recommend you read the first article (link given below), before going through this article.
Continue reading “#React Components – Zero To Hero Series – Part 2 by Vipul Jain cc @CsharpCorner #ReactJS”