-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sdds-serv: add TextArea component #1263
sdds-serv: add TextArea component #1263
Conversation
Theme Builder app deployed! https://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1263/ |
Documentation preview deployed! website:https://plasma.sberdevices.ru/pr/pr-1263/ |
⚡ Component performance testingResult: 🟢 OK |
2d2842c
to
39b712b
Compare
⚡ Component performance testingResult: 🟢 OK |
type TextAreaComponentType = ForwardRefExoticComponent<TextAreaProps & RefAttributes<HTMLTextAreaElement>>; | ||
|
||
const mergedConfig = mergeConfig(textAreaConfig, config); | ||
const TextAreaComponent = component(mergedConfig) as TextAreaComponentType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а здесь точно нужно явное приведение типов? Разве то, что генерирует функция не подойдёт?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Без приведения ловил ошибку ts2742
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а можешь показать, что за ошибка?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Без каста TextAreaComponentType
прилетает ts2742
:
The inferred type of 'TextArea' cannot be named without a reference to '../../../../plasma-new-hope/node_modules/@salutejs/plasma-core'. This is likely not portable. A type annotation is necessary.
typeAnnotation.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а, ну такую проблему мы уже решали
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в файле plasma/packages/plasma-new-hope/src/components/TextArea/TextArea.types.tsx
, вместо импорта из plasma-core, скопируй файл TextareaHTMLAttributes
в директорию /plasma/packages/plasma-new-hope/src/types
. И добавь в этот файл по аналогии с InputHTMLAttributes
(который лежит там же) вот эту инфу:
// INFO: Issue об этом решении - https://github.com/salute-developers/plasma/issues/1219
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@neretin-trike Вопрос на миллион, в b2c/web у нас тоже кастинг -
const TextAreaComponent = component(mergedConfig) as ForwardRefExoticComponent<
TextAreaProps & RefAttributes<HTMLTextAreaElement>
>;
кастинг - это проблема?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше без него обходиться там, где это возможно. В b2/web это нужно для обратной совместимости
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
поправил
39b712b
to
4289336
Compare
⚡ Component performance testingResult: 🟢 OK |
4289336
to
626c95a
Compare
⚡ Component performance testingResult: 🟢 OK |
626c95a
to
0b2112e
Compare
⚡ Component performance testingResult: 🟢 OK |
TextArea
TextArea
портирован вsdds
What/why changed
resize
помечено какdeprecated
в библиотекахplasma-{b2c, web}
sdds-serv
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via: