synacor / preact-i18n

Simple localization for Preact.
BSD 3-Clause "New" or "Revised" License
206 stars 18 forks source link

Add a hook version of withText for those who want to use hooks with Preact X? #41

Closed craigdanj closed 4 years ago

craigdanj commented 4 years ago

I was thinking we could use a hook version of the withText HOC. So developers who wish to use hooks can do something like:

const firstName = useText('profile.user.firstName')

pl12133 commented 4 years ago

Fixed by https://github.com/synacor/preact-i18n/commit/a451350292148d1332a0321eb5bac34c076c2630 and released in 2.1.1-preactx.

Michael-1 commented 3 years ago

It would be good to have this officially documented.