728x90 반응형 SMALL programming437 React) isRequired //App.js//import Mycomponent from "./mycomponent";//// const App =()=>{// return react;// };//// export default App;import propTypes from "prop-types";const mycomponent = ({name, favoriteNumber, children}) =>{ return( hello, my name is {name} children value is {children} my favorite number is {favoriteNumber} );};m.. 2025. 4. 10. React) multiple state value import { Component } from "react";class Counter extends Component{ constructor(props) { super(props); this.state = { number: 0, fixedNumber: 0 }; } render(){ const {number, fixedNumber} = this.state; return ( {number} Not change value : {fixedNumber} { .. 2025. 4. 9. React) mycomponent mycomponentconst MyComponent = () =>{ return my new component;};export default MyComponent;mainimport Mycomponent from "./mycomponent";const App=() =>{ return ;};export default App;### Functional Component Structure - **Function Definition**: `MyComponent` is defined as an arrow function, a common syntax for creating functional components in React. Functional components a.. 2025. 4. 8. React) mycomponent props children import myComponent from "./frames/Component_file/MyComponent";const mycomponent = props => { return ( hello, my name is {props.name}. children value is {props.children}. );}mycomponent.defaultProps = { name : 'basic name'};export default mycomponent;### Component Definition - **Functional Component**: `mycomponent` is defined as a f.. 2025. 4. 7. 이전 1 2 3 4 ··· 110 다음 728x90 반응형 LIST