i18next / react-i18next

Internationalization for react done right. Using the i18next i18n ecosystem.
https://react.i18next.com
MIT License
9.3k stars 1.03k forks source link

use arrow functions where possible #1762

Closed VIKTORVAV99 closed 4 months ago

VIKTORVAV99 commented 4 months ago

By converting all functions to arrow functions we optimize two things. First we can directly remove some return statements by using implicit return and secondly it allows bundlers to compress mupltiple const declarations into a single const declaration with multiple constants. Example:

const test1 = "test1"
const test2 = "test2"
const test3 = "test3"

Becomes

const test1 = "test1", test2 = "test2", test3 = "test3"

Which saves some bytes that would otherwise be used for the function keyword in the pervious version.

Checklist

coveralls commented 4 months ago

Coverage Status

coverage: 97.143% (+0.03%) from 97.11% when pulling fd41f98a89493ead38d61c4fb52a27f2315c45ff on VIKTORVAV99:use_arrow_functions_where_possible into 5c3c3ebedff58919f7a84f2198a166b385700bcc on i18next:master.