import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);
npm i prop-types
import PropTypes from "prop-types";
function Button({ text }) {
return <button>{text}</button>;
}
export default Button;
import PropTypes from "prop-types";
function Button({ text }) {
return <button>{text}</button>;
}
Button.proTypes = {
text: PropTypes.string.isRequired,
}; //props의 타입은 String이며 이 props는 Required된다.
export default Button;
꾸준하게 공부하자.