Open LehaIvanov opened 1 year ago
https://github.com/Flowseal/TravelPractice/blob/8e8d193b2c2ee52de62bb03317dd298d916e160b/Lesson8%20(Currency%20Converter)/WebAppUI/src/components/ConvertationForm/ConverationForm.tsx#L16
type ConvertationFormProps = { currencies: Currency[]; price: number; paymentAmount: string; paymentCurrency: string; purchasedCurrency: string; onCurrencyChange: (paymentCurrency: string, purchasedCurrency: string, swapped: boolean) => void; onPaymentAmountChange: (paymentAmount: string) => void; };
Если добавиться ещё вложенность то совсем тяжело будет все эти параметры через пропсы переадвать. Почему-бы не использовать Context?
Context
https://github.com/Flowseal/TravelPractice/blob/8e8d193b2c2ee52de62bb03317dd298d916e160b/Lesson8%20(Currency%20Converter)/WebAppUI/src/components/ConvertationForm/ConverationForm.tsx#L16
Если добавиться ещё вложенность то совсем тяжело будет все эти параметры через пропсы переадвать. Почему-бы не использовать
Context
?