Default export?
Default export is a JavaScript feature that allows a file to export one main value (function, component, or variable) so it can be imported without curly braces in another file.
What is components?
Component is a function or class that returns JSX and represents a part of the UI.
Types of Components:
- Class Component
- Function Component
Class Component
A class component is created using a JavaScript class and must have a render() method.
Example:
class Hello extends React.Component {
render() {
return <h1>Hello</h1>;
}
}
Function Component
A function component is a normal JavaScript function that returns JSX.
Example
function Hello() {
return <h1>Hello</h1>;
}
JavaScript (JS):
JavaScript is a programming language used to create logic, behavior, and interactivity in web applications.
JSX:
JSX is a JavaScript syntax extension used in React that allows writing HTML-like code inside JavaScript to define UI.
XML:
XML (eXtensible Markup Language) is a markup language used to store and transport data in a structured format.
Top comments (0)