Introducing the React Context API

  • The new React Context API is touted (at least on Twitter and a number of articles) as solving the need to use a state management tool, when I think in reality what it solves is easy dependency injection: Take something that lives at the top of your app and directly…
  • It essentially gives you an easy way to have state live at the top level in your component tree ( in this case) but “inject” it as a prop in a lower level component in the state tree.
  • A Consumer works hand-in-hand with the Context’s Provider, essentially allowing you to reach into your Context, and easily inject the Context’s value into a component, skipping many levels in the component tree.
  • Now that we’ve set up our Context and have created the Provider which wraps our app at the top level, we can now inject its into any of our lower level components.
  • When thinking of how to organize an app which uses React Context, I wanted to avoid having the Consumer code in the same file as the component which it “wraps”… the reason for this is because it makes it difficult to test the component in isolation.

We’ll take a look at the new React Context API, how to use it, what it does, and if it should replace Redux or MobX for your go-to state management option.
Continue reading “Introducing the React Context API”

Advanced React Patterns — Exclusive Workshop

  • Making React components that can be used in multiple places is not hard.
  • What is hard is when the use cases differ.
  • Without the right patterns, you can find yourself with a highly complex component that requires a lot of configuration props and way too many if statements.

Join Kent C. Dodds and learn how to master React components.
Continue reading “Advanced React Patterns — Exclusive Workshop”

Build a Server-rendered ReactJS Application with Next.js from @tgrecojs on @eggheadio

Build a Server-rendered ReactJS Application with Next.js - #react course by @tgrecojs

  • In this course we we’ll see just how quickly next.js makes the process of building server-rendered ReactJS applications by creating and deploying an application that loads blog posts from the Google Blogger API.
  • Along the way we’ll learn about many of the amazing features Next.js provides for us out of the box, such as route prefetching and code-splitting, thus allowing us to spend more time developing and virtually no time setting up our environment.
  • Additionally, we’ll learn about the core concepts behind the framework and see how we can leverage them to create dynamic routes and integrate Material-UI on the server.
  • We won’t have to worry about using any specific architecture to handle state, instead we will just pass our data as ReactJS using Next.js’ lifecycle hook.
  • Throughout this course we will see why Next.js has gained such an amazing reputation as a “minimalist framework” by supplying users with “pretty” error messages.

Continue reading “Build a Server-rendered ReactJS Application with Next.js from @tgrecojs on @eggheadio”

Build a Server-rendered ReactJS Application with Next.js from @tgrecojs on @eggheadio

Build a Server-rendered ReactJS Application with Next.js - #react course by @tgrecojs

  • In this course we we’ll see just how quickly next.js makes the process of building server-rendered ReactJS applications by creating and deploying an application that loads blog posts from the Google Blogger API.
  • Along the way we’ll learn about many of the amazing features Next.js provides for us out of the box, such as route prefetching and code-splitting, thus allowing us to spend more time developing and virtually no time setting up our environment.
  • Additionally, we’ll learn about the core concepts behind the framework and see how we can leverage them to create dynamic routes and integrate Material-UI on the server.
  • We won’t have to worry about using any specific architecture to handle state, instead we will just pass our data as ReactJS using Next.js’ lifecycle hook.
  • Throughout this course we will see why Next.js has gained such an amazing reputation as a “minimalist framework” by supplying users with “pretty” error messages.

Continue reading “Build a Server-rendered ReactJS Application with Next.js from @tgrecojs on @eggheadio”

Force a React Component to Re-Render

  • The beauty of React components is that they automagically render and update based on a change in or ; simply update the state from any place and suddenly your UI element updates — awesome!
  • There may be a case, however, where you simply want to brute force a fresh render of a React component.
  • Note:  In most cases you should never force a React component to re-render; re-rendering should always be done based on state or props changes.
  • Nonetheless, I don’t judge and there may be a case where you legitimately need to force a React component to re-render so let’s have it!
  • There are multiple ways to force a React component render but they are essentially the same.

Continue reading “Force a React Component to Re-Render”

Build a Server-rendered ReactJS Application with Next.js from @tgrecojs on @eggheadio

Build a Server-rendered ReactJS Application with Next.js - #react course by @tgrecojs

  • In this course we we’ll see just how quickly next.js makes the process of building server-rendered ReactJS applications by creating and deploying an application that loads blog posts from the Google Blogger API.
  • Along the way we’ll learn about many of the amazing features Next.js provides for us out of the box, such as route prefetching and code-splitting, thus allowing us to spend more time developing and virtually no time setting up our environment.
  • Additionally, we’ll learn about the core concepts behind the framework and see how we can leverage them to create dynamic routes and integrate Material-UI on the server.
  • We won’t have to worry about using any specific architecture to handle state, instead we will just pass our data as ReactJS using Next.js’ lifecycle hook.
  • Throughout this course we will see why Next.js has gained such an amazing reputation as a “minimalist framework” by supplying users with “pretty” error messages.

In this course we we’ll see just how quickly next.js makes the process of building server-rendered ReactJS applications by creating and deploying an application that loads blog posts from the Google Blogger API.
Along the way we’ll learn about many of the amazing features Next.js provides for us out of the box, such as route prefetching and code-splitting, thus allowing us to spend more time developing and virtually no time setting up our environment.
Additionally, we’ll learn about the core concepts behind the framework and see how we can leverage them to create dynamic routes and integrate Material-UI on the server. We won’t have to worry about using any specific architecture to handle state, instead we will just pass our data as ReactJS props using Next.js’ getInitialProps lifecycle hook.
Throughout this course we will see why Next.js has gained such an amazing reputation as a “minimalist framework” by supplying users with “pretty” error messages. Once finished, we’ll deploy our application to a live URL using the now-cli npm module.
Continue reading “Build a Server-rendered ReactJS Application with Next.js from @tgrecojs on @eggheadio”

Case Study — React Finland Website – React Finland – Medium

  • Case Study — React Finland WebsiteA website is often the primary entry point of people to a conference.
  • Read Technology behind React Finland for the technology choices.One of the early designsDesign is About PresentationAlthough a site can be structured well and filled with good content, if the design is poor, you might lose people.
  • In the case of React Finland, we wanted to integrate the idea of Finland to the site somehow.
  • fiI realized during early January that although the conference is selling quite well, it could do better if we improved the design of the site.
  • To see how the design work progressed, see [1], [2], and the final result.The resulting designConclusionAlthough React Finland site is quite small, it has been a great case for me to work on as it’s more than only the technical part.

A website is often the primary entry point of people to a conference. For this reason, it is important to get it right as it a significant part of the brand identity. Essentially a good website…
Continue reading “Case Study — React Finland Website – React Finland – Medium”

Build a Server-rendered ReactJS Application with Next.js from @tgrecojs on @eggheadio

Build a Server-rendered ReactJS Application with Next.js by @tgrecojs on @eggheadio

  • In this course we we’ll see just how quickly next.js makes the process of building server-rendered ReactJS applications by creating and deploying an application that loads blog posts from the Google Blogger API.
  • Along the way we’ll learn about many of the amazing features Next.js provides for us out of the box, such as route prefetching and code-splitting, thus allowing us to spend more time developing and virtually no time setting up our environment.
  • Additionally, we’ll learn about the core concepts behind the framework and see how we can leverage them to create dynamic routes and integrate Material-UI on the server.
  • We won’t have to worry about using any specific architecture to handle state, instead we will just pass our data as ReactJS using Next.js’ lifecycle hook.
  • Throughout this course we will see why Next.js has gained such an amazing reputation as a “minimalist framework” by supplying users with “pretty” error messages.

In this course we we’ll see just how quickly next.js makes the process of building server-rendered ReactJS applications by creating and deploying an application that loads blog posts from the Google Blogger API.
Along the way we’ll learn about many of the amazing features Next.js provides for us out of the box, such as route prefetching and code-splitting, thus allowing us to spend more time developing and virtually no time setting up our environment.
Additionally, we’ll learn about the core concepts behind the framework and see how we can leverage them to create dynamic routes and integrate Material-UI on the server. We won’t have to worry about using any specific architecture to handle state, instead we will just pass our data as ReactJS props using Next.js’ getInitialProps lifecycle hook.
Throughout this course we will see why Next.js has gained such an amazing reputation as a “minimalist framework” by supplying users with “pretty” error messages. Once finished, we’ll deploy our application to a live URL using the now-cli npm module.
Continue reading “Build a Server-rendered ReactJS Application with Next.js from @tgrecojs on @eggheadio”

ComponentDoesWhat? React Native Cheat Sheets – Erin Fox – Medium

  • React Native Cheat SheetsBefore I started my job at Major League Soccer, I only had one week of React training.
  • Great news when I was about to join a team of React engineers to rebuild their mobile app in React Native, right?Over 6 months have gone by now and I have learned SO MUCH, it’s crazy.
  • (oh, but ++ because it’s build in React)Flex of Dror BiranThere’s been days when I wanted to pull my hair out because my flex style properties weren’t working the way I wanted them too.
  • Even the zombies help.SVG feel like an SVG queen whenever I use this handy conversion site.Easing only is it really fun to hover over all of these functions to see their animations, it’s really helpful.Images (when you have spend way to much time trying to find placeholder photos.
  • Command r. Command much (almost) everything you need to get started with GraphQL is here.

Before I started my job at Major League Soccer, I only had one week of React training. Great news when I was about to join a team of React engineers to rebuild their mobile app in React Native…
Continue reading “ComponentDoesWhat? React Native Cheat Sheets – Erin Fox – Medium”