synacor / preact-i18n

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

Returning array form render can run preat-i18n into trouble #59

Closed sadaszewski closed 2 years ago

sadaszewski commented 2 years ago

I was getting a e.replace is not a function error when returning an array of elements in the render() method of one of my components. This works flawlessly with preact only but preact-i18n sometimes can start failing. I have not had the time to determine the exact conditions but I presume it has something to do with assuming that it the component is nested in another component and not in an array.

sadaszewski commented 2 years ago

Actually I am still getting this error from time to time. Sometimes I have to rebuild the app a couple of times to get it to work, I am pretty sure it is a bug.

sadaszewski commented 2 years ago

I think I can confirm the initial suspicion in the end. I have found more instances where I was returning an array from render() and after refactoring those it works reliably.

sadaszewski commented 2 years ago

It was another problem, solved now. False alert.