react
Components And Props
opy https://teamtreehouse.com/library/react-basics-2/introducing-props/components-and-props Components and Props An important detail to remember about props is that they are “read only” (or immutable), which means that a component can only read the props given to it, never change them. The (parent) component higher in the tree owns and controls the property values. For example, if you try to
Components And Props Read More »
React – Comments
Comments In React https://stackoverflow.com/questions/30766441/how-to-use-comments-in-react#comment103855263_30766542 Within the render method comments are allowed, but in order to use them within JSX, you have to wrap them in braces and use multi-line style comments. <div className=”dropdown”> {/* whenClicked is a property not an event, per se. */} <Button whenClicked={this.handleClick} className=”btn-default” title={this.props.title} subTitleClassName=”caret”></Button> <UnorderedList /></div> Copy You can read
React – Post Form Data To Api
Post form data to api endpoint You need to build your request body using the FormData API. The FormData interface provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use
React – Post Form Data To Api Read More »
React – Cheatsheet
=> The React script allows us to write React components => The ReactDOM script allows us to place our components and work with them in the context of the DOM ReactDOM.render(<Greeting />, document.getElementById(‘root’)); Copy Translating the line of code above to English would sound something like this; Use ReactDOM’s render method to render the Greeting
React – Cheatsheet Read More »
React – ES6 – Commonly Used
Commonly used ES6 Features Throughout the rest of this book, a number of ES6 features will be used consistently. If you do not have prior experience with ES6 features, this brief introduction will come in handy. If you’re comfortable with ES6 features, skip this section and head to chapter 2 to get started writing your
React – ES6 – Commonly Used Read More »