728x90
λ°μν
interface ButtonProps {
sum: (a: number, b: number) => number;
logMessage: (message: string) => void;
// ποΈ turn off type checking
doSomething: (params: any) => any;
}
function Container({sum, logMessage, doSomething}: ButtonProps) {
console.log(sum(10, 15));
logMessage('hello world');
doSomething('abc');
return <div>Hello world</div>;
}
const App = () => {
const sum = (a: number, b: number) => {
return a + b;
};
const logMessage = (message: string) => {
console.log(message);
};
return (
<div>
<Container sum={sum} logMessage={logMessage} doSomething={logMessage} />
</div>
);
};
export default App;
728x90
λ°μν
'React Native' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
setDataList WARN SerializableStateInvariantMiddleware took ... (0) | 2023.01.10 |
---|---|
React Native Module μμ λ°μ΄ν° Callback μ Type μλ¬.. (0) | 2022.11.17 |
react native new Map() 컬λμ μ¬μ©νκΈ° (0) | 2022.09.15 |
SNS λ‘κ·ΈμΈ (0) | 2022.03.18 |
RN νλ‘μ νΈ μ΄λ¦ λ³κ²½ (0) | 2022.03.14 |