Skip to content

Translate "Building Your Own Hooks" - #150

Merged
another-guy merged 4 commits into
reactjs:masterfrom
tesler:translation-hooks-custom
Feb 28, 2019
Merged

Translate "Building Your Own Hooks"#150
another-guy merged 4 commits into
reactjs:masterfrom
tesler:translation-hooks-custom

Conversation

@tesler

@teslertesler commented Feb 15, 2019

Copy link
Copy Markdown
Contributor

Не осилил нормально перевести предложение
ac692e5#diff-76bf3361c22ba42425c012b2b1f04f3dL144

Custom Hooks are a convention that naturally follows from the design of Hooks, rather than a React feature.

Название раздела и ссылок на другие выбирал исходя из обсуждений и пулов.

@teslertesler mentioned this pull request Feb 15, 2019
88 tasks
@gcor

gcor commented Feb 15, 2019

Copy link
Copy Markdown
Contributor

Локальное состояние → внутреннее

@tesler
teslerforce-pushed the translation-hooks-custom branch from ac692e5 to 9090c96CompareFebruary 15, 2019 22:28
@tesler

Copy link
Copy Markdown
ContributorAuthor

@gcor спасибо за замечание, поправил

@lex111lex111 added the needs review A pull request ready to be reviewed label Feb 18, 2019
@lex111

Copy link
Copy Markdown
Contributor

Custom Hooks are a convention that naturally follows from the design of Hooks, rather than a React feature.

Пользовательские хуки — это скорее соглашение, соответсвующее [естественным образом вытекает из] дизайну [задумке] хуков, нежели чем [а не] возможность [функционал] самого React.

Т.е. например, пользовательские хуки можно назвать blah, а не useBlah, и это сработает (если плагин для линтера, который проверяет хуки, т.е. если он пользовательский хук назван useBlah, то он проверяется в соответствие с определёнными правилами. Либо я не так понимаю, но примерно как-то так.

@tesler

tesler commented Feb 19, 2019

Copy link
Copy Markdown
ContributorAuthor

Т.е. например, пользовательские хуки можно назвать blah, а не useBlah, и это сработает (если плагин для линтера, который проверяет хуки, т.е. если он пользовательский хук назван useBlah, то он проверяется в соответствие с определёнными правилами. Либо я не так понимаю, но примерно как-то так.

Это относится скорее к следующему пункту
5895413#diff-76bf3361c22ba42425c012b2b1f04f3dR146

Должен ли я писать “use” в начале названия хука? Очень желательно. Это важное условие, без которого мы не сможем автоматически проверять нарушения правил хуков, потому что не определим, содержит ли определённая функция вызовы хуков внутри.

Но твой вариант перевода лучше. Поправлю

@another-guyanother-guy self-assigned this Feb 25, 2019

@another-guyanother-guy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Убрать бы небольшие стилистические шероховатости. В целом, читается легко! Спасибо @tesler

Comment threadcontent/docs/hooks-custom.md Outdated
Comment threadcontent/docs/hooks-custom.md Outdated
Comment threadcontent/docs/hooks-custom.md Outdated
Comment threadcontent/docs/hooks-custom.md Outdated
Comment threadcontent/docs/hooks-custom.md Outdated
Comment threadcontent/docs/hooks-custom.md Outdated
Comment threadcontent/docs/hooks-custom.md Outdated
Comment threadcontent/docs/hooks-custom.md Outdated
@another-guyanother-guy removed their assignment Feb 25, 2019
@lex111

lex111 commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

@another-guy внёс твои правки + добавил собственные. Посмотри ещё раз пулреквест, и если всё ок, то сливай.

P.S. билд не проходит, потому что мастер старый, так что можно смело сливать, если что.

@lex111lex111 self-assigned this Feb 28, 2019
@lex111lex111 assigned another-guy and unassigned lex111Feb 28, 2019
@netlify

netlifyBot commented Feb 28, 2019

Copy link
Copy Markdown

Deploy preview for ru-reactjs failed.

Built with commit 9f190cc

https://app.netlify.com/sites/ru-reactjs/deploys/5c772cc6c1a56a00079923fb

@another-guy
another-guy merged commit 470c690 into reactjs:masterFeb 28, 2019
@another-guyanother-guy removed their assignment Mar 2, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs reviewA pull request ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@tesler@gcor@lex111@another-guy