Skip to content

Commit

Permalink
fix for withTranslation.js: Unexpected token (28:39)
Browse files Browse the repository at this point in the history
as discussed in #982
  • Loading branch information
koverg70 authored Nov 13, 2019
1 parent 5f2fc87 commit d5e2c87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/withTranslation.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function withTranslation(ns, options = {}) {

I18nextWithTranslation.WrappedComponent = WrappedComponent;

const forwardRef = (props, ref) => <I18nextWithTranslation {...props} forwardedRef={ref} />;
const forwardRef = (props, ref) => React.createElement(I18nextWithTranslation, Object.assign({}, props, { forwardedRef: ref }));

return options.withRef ? React.forwardRef(forwardRef) : I18nextWithTranslation;
};
Expand Down

0 comments on commit d5e2c87

Please sign in to comment.