React Flashcards
What is a React element?
React element is an object that’s describes DOM node.
What is Babel?
Babel is a tool(complier) to convert ECMAScript 2015 code into a backwards compatible version.
What is a Plug-in?
Plug-in is a software that ads specific feature to an existing computer program
What is a Webpack loader?
Webpack loader is a plugin which transforms source code of module.
How can you make Babel and Webpack work together?
By using loader as plugin in webpack config.js (babel loader)
What is JSX?
It’s XML style extension to JavaScript language
Why must the React object be imported when authoring JSX in a module?
It needs to be available so we can call method on it.
This refers to - import React from ‘react’
How can you make Webpack and Babel work together to convert JSX into valid JavaScript?
To convert JSX into valid JavaScript we use plugin react jsx.
How do you mount a component to the DOM?
Adding is as a first parameter into ReactDOM.render method, second is DOM element where to mount it.
What are props in React?
Props in React are objects. Props are arguments pass to React components.
How do you pass props to a component?
We pass props to a component as key:value -> name=”Max”
How do you write JavaScript expressions in JSX?
Between curly bracers
How do you create “class” component in React?
Using keyword class MyComponent extends React.Component{ return () { content }}
How do you access props in a class component?
using this.props
What is the purpose of state in React?
It’s like data model, when you update it react change website