Skip to content

Conversation

@Manblax
Copy link

@Manblax Manblax commented Jun 21, 2024

No description provided.

Copy link
Contributor

@cmath10 cmath10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В целом бы еще пройтись по вызовам React.* и импортировать вещи отдельно. Еще было бы неплохо дополнить storybook, думаю аналогичную доку пока сделать, как в m3-vue рабочем пространстве.

@@ -0,0 +1,149 @@
import React, { useState, useEffect, useRef, HTMLAttributes } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут бы разделить импорт типов и импорт хуков. Еще стоит убрать импорт React, лучше импортировать FC отдельно, чтобы при сборке лучше работал treeshaking

const [focused, setFocused] = useState(false);
const inputElement = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);

const onInput = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут надо бы использовать хук useCallback, иначе при перерисовке будет заново создаваться. Еще надо бы отдельно импортировать тип ChangeEvent. Аналогично для остальных обработчиков

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants