¿Qué son los componentes en React?
Components are independent and reusable bits of code.
praja wani
Components are independent and reusable bits of code.
import { ReactComponent as SVGIcon } from '../assets/someIcon.svg
function App() {
return (
<div>
/* SVGIcon is a React Component */
<SVGIcon />
</div>
);
}
// 'ReactComponent' is a Create React App ([email protected]+) feature
import React from 'react';
import ReactDOM from 'react-dom';
class MyComponentClass extends React.Component {
render() {
return <h1>Hello world</h1>;
}
}
ReactDOM.render(
<MyComponentClass />,
document.getElementById('app')
);
1
2
3
4
5