Giter Site home page Giter Site logo

cyf-react-syntax's Introduction

๐Ÿ‘‹ Hello, my name is Nate Wright

and I have more than a decade of experience building open source tools for the web. I had a previous career in journalism and Iโ€™m interested in working on projects at the intersection of information, communication, and social change.

View my portfolio and contact me if you think I can help you with something.

cyf-react-syntax's People

Contributors

natewr avatar scott-ad-riley avatar

Watchers

 avatar

Forkers

scott-ad-riley

cyf-react-syntax's Issues

review

Really good test!

Just some minor things I noticed, feel free to ignore some/all of them:


Components

//lonely comma in there
this.state = {
			fullName: '',
		};

Also, <Button> component needs a self closing slash at the end.


HTML Output section:

"There are two components in the code above. What are their names?"

There are only some HTML tags in that resulting code (not really any components). Should this read: "The above code was rendered by two React components. What are their names?"


Props

Should we re-name the Button component to something else? It renders an html button as its child, which gets its own set of attributes. Might be confusing to which button we're referring when talking about props? For example: "The Button component receives isDisabled and text properties. These are passed to the button as props"

In the ContactForm component, is method a property passed to the Button component?
What are the names of the properties that the Button component receives from the ContactForm?

Should we use "props" everywhere (or inputs) instead of "properties"? Looking at React's docs it seems that they never use the term "properties" (even if linguistically that's what it stands for).


State

// the semicolons won't work inside setState (here and a few other places)
this.setState({
			emailAddress: event.target.value;
		});

JSX and HTML

// needs to be this.props.text
render () {
	return (
		<button>{props.text}</button>
	);
}

In a React component, you write JSX code in the render function.

Might be worth saying that it applies only to class components. In functional components, you return it directly.

Instead of "compiled" could we say:

// Will get converted to this HTML
<button id="submit-button">Submit</button>

Attributes and child components

typo:
"How can yout ell if"

When we write attributes on a React component (), we call them properties.

Are they called "properties"? I thought React tries to be as close as possible to the native browser APIs so when you use React components you write them the same way you'd write a normal HTML tag, and "add" attributes to them. Then inside the component's implementation, we get them as part of this "props" object. I might be wrong, this is just an assumption, but maybe it's not wrong to let them think they're also "attributes"?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.