stefalda / react-localization

Simple module to localize the React interface using the same syntax used in the ReactNativeLocalization module.
MIT License
373 stars 58 forks source link

Fix formatString return type #133

Closed joshsalverda closed 1 year ago

joshsalverda commented 1 year ago

From my understanding, based on https://github.com/stefalda/react-localization/issues/46, it should only ever return a string now.

stefalda commented 1 year ago

Hi Josh, are you sure it always returns a string... even if it's hasObject is true?

joshsalverda commented 1 year ago

Ah oops you're right, although I wonder if there's a nicer way to type it in that case? 🤔 I'm still learning typescript but I'll try taking a closer look. With the current way I need to account for it potentially being an array everywhere, even when I know it's a string.