Skip to content
Knowing your weight on some potentially habitable exoplanets (kg/lbs) -render props example-
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public
src
.gitignore
README.md
package.json
yarn.lock

README.md

Your weight on some potentially habitable exoplanets

This project implements React's Render Props pattern (children as a function approach), trying to give you a good example of its value.

Also gives you an easy way to obtain your weight in your favorite exoplanet, just for free, you know..

Render Props applied

In this example we want to know our hypothetical weight in some known exoplanets. The piece of info we need to share between components is our weight on Earth (input value), as every planet knows how to calculate its equivalent weight in its particular conditions.

In this implementation, you are going to find a 'Weight' component that's in charge of store the weight value in his own state, and an 'APP' component that invokes 'Weight' applying render props in order to obtain the Weight state value and pass it as a property to the different exoplanets.

In order to maintain simplicity, Exoplanet components remain fully independent, even sharing a lot of their code.

Stack

This project was bootstrapped with CRA.

  • React
  • Css Modules
  • Webpack

Install instructions

git clone https://github.com/emilioponce/your-weight-on-habitable-exoplanets.git
yarn
yarn start
You can’t perform that action at this time.