fac-13 / GP_ProjectBernadette

My Wayfinder - A React decision tree app to help carers understand jargon and find relevant resources more quickly.
https://my-wayfinder.herokuapp.com/
5 stars 5 forks source link

{ destructuring } #98

Open matthewdking opened 6 years ago

matthewdking commented 6 years ago

Yay for destructing props and stuff throughout your project 🎉

Could destructure a few on import eg

import React, { Component, Fragment } from 'react';
vlbee commented 6 years ago

We initially decided not to do this because then we would be importing 'React' but not using it anywhere.

By using React.Component and React.Fragment we also have a clarity in the JSX on which are our components vs native to React.

Team - what are your thoughts?

matthewdking commented 6 years ago

My understanding is that React just needs to be in the scope for wherever you are writing JSX

matthewdking commented 6 years ago

Destructuring on import is a pattern that is widely used