Skip to content

Commit

Permalink
Use ES6 function style, remove unnecessary div from test component
Browse files Browse the repository at this point in the history
  • Loading branch information
neilius committed Sep 21, 2016
1 parent 2643fdb commit 743da90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Helmet.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const getTitleFromPropsList = (propsList) => {

if (innermostTemplate && innermostTitle) {
// use function arg to avoid need to escape $ characters
return innermostTemplate.replace(/\%s/g, function () { return innermostTitle; });
return innermostTemplate.replace(/\%s/g, () => innermostTitle);
}

const innermostDefaultTitle = getInnermostProperty(propsList, "defaultTitle");
Expand Down
6 changes: 2 additions & 4 deletions src/test/HelmetTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,8 @@ describe("Helmet", () => {
const dollarTitle = "te$t te$$t te$$$t te$$$$t";

ReactDOM.render(
<div>
<Helmet titleTemplate={"This is a %s"}
title={dollarTitle} />
</div>,
<Helmet titleTemplate={"This is a %s"}
title={dollarTitle} />,
container
);

Expand Down

0 comments on commit 743da90

Please sign in to comment.