본문 바로가기
728x90
반응형
SMALL

전체 글435

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.
React) myComponent props value const mycomponent = props =>{ return hello, my name is {props.name};};mycomponent.defaultProps ={ name :'user name'};export default mycomponent;### Functional Component with Props - **Functional Component**: The component is defined as a functional component that accepts `props` as an argument. This simple pattern is used for components that do not need to manage state or use lif.. 2025. 4. 6.
React) out of value to props // const mycomponent = props =>{// const {name, children} = props;// return(// // hello. my name is {name}.// children value is {children}.// // );// };//// mycomponent.defaultProps = {// name : 'basic name'// };//// export default mycomponent;const mycomponent = ({name, children}) =>{ return( hello.. 2025. 4. 5.
728x90
반응형
LIST