Skip to content

Commit a1d186a

Browse files
committed
fix linting issues
1 parent 0816b85 commit a1d186a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

fluent-react/src/localized.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function Localized(props) {
5555
const { id, attrs, children: child = null } = props;
5656
const { l10n, parseMarkup } = useContext(FluentContext);
5757

58-
if (l10n == null) {
58+
if (l10n === null) {
5959
throw new Error(
6060
"<Localized/> needs to have a <LocalizationProvider/> up in the tree"
6161
);

fluent-react/src/provider.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function LocalizationProvider(props) {
3838
const parseMarkup = useMemo(() => props.parseMarkup || createParseMarkup(), [
3939
props.parseMarkup
4040
]);
41-
const value = useMemo(
41+
const contextValue = useMemo(
4242
() => {
4343
const l10n = {
4444
getBundle: id => mapBundleSync(bundles, id),
@@ -75,7 +75,11 @@ export default function LocalizationProvider(props) {
7575
[bundles, parseMarkup]
7676
);
7777

78-
return createElement(FluentContext.Provider, { value }, props.children);
78+
return createElement(
79+
FluentContext.Provider,
80+
{ value: contextValue },
81+
props.children
82+
);
7983
}
8084

8185
LocalizationProvider.propTypes = {
@@ -90,7 +94,7 @@ function isIterable(props, propName, componentName) {
9094
if (!prop) {
9195
return new Error(
9296
`The ${propName} prop supplied to ${componentName} is required.`
93-
)
97+
);
9498
}
9599

96100
if (Symbol.iterator in Object(prop)) {

0 commit comments

Comments
 (0)