4 ms·
The simplicity of the function isn't the point, the idea is that the language locale is a piece of shared state between all instances of the Translation compone
by root_axis 5y ago
The simplicity of the function isn't the point, the idea is that the language locale is a piece of shared state between all instances of the Translation component. With this approach, all instances of the Translation component are able to know which translation set to use without developers having to drill down a "locale" prop through the entire component hierarchy everywhere text is used (i.e. the entire application)