Skip to content
This repository has been archived by the owner on Jun 3, 2019. It is now read-only.

Get linting to pass, update snapshot accordingly #553

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions server/middleware/reactApplication/ServerHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ function ServerHTML(props) {
const { asyncComponentsState, helmet, nonce, reactAppString } = props;

// Creates an inline script definition that is protected by the nonce.
const inlineScript = body =>
<script nonce={nonce} type="text/javascript" dangerouslySetInnerHTML={{ __html: body }} />;
const inlineScript = body => (
<script nonce={nonce} type="text/javascript" dangerouslySetInnerHTML={{ __html: body }} />
);

const headerElements = removeNil([
...ifElse(helmet)(() => helmet.meta.toComponent(), []),
Expand Down Expand Up @@ -94,28 +95,22 @@ function ServerHTML(props) {
return (
<HTML
htmlAttributes={ifElse(helmet)(() => helmet.htmlAttributes.toComponent(), null)}
headerElements={headerElements.map((x, idx) =>
(<KeyedComponent key={idx}>
{x}
</KeyedComponent>),
)}
bodyElements={bodyElements.map((x, idx) =>
(<KeyedComponent key={idx}>
{x}
</KeyedComponent>),
)}
headerElements={headerElements.map((x, idx) => (
<KeyedComponent key={idx}>{x}</KeyedComponent>
))}
bodyElements={bodyElements.map((x, idx) => <KeyedComponent key={idx}>{x}</KeyedComponent>)}
appBodyString={reactAppString}
/>
);
}

ServerHTML.propTypes = {
// eslint-disable-next-line react/forbid-prop-types
asyncComponentsState: PropTypes.object,
asyncComponentsState: PropTypes.object.isRequired,
// eslint-disable-next-line react/forbid-prop-types
helmet: PropTypes.object,
nonce: PropTypes.string,
reactAppString: PropTypes.string,
helmet: PropTypes.required.object.isRequired,
nonce: PropTypes.required.string.isRequired,
reactAppString: PropTypes.required.string.isRequired,
};

// EXPORT
Expand Down
12 changes: 9 additions & 3 deletions shared/components/DemoApp/AsyncAboutRoute/AboutRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ function AboutRoute() {
<title>About</title>
</Helmet>

<p>Produced with ❤️</p>
<p>
Produced with
{'&nbsp;'}
<span aria-label="heart" role="img">
❤️
</span>
</p>

<p>
View our contributors list on our
{' '}
{'&nbsp;'}
<a href="https://github.com/ctrlplusb/react-universally">GitHub</a>
{' '}
{'&nbsp;'}
page.
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,24 @@ exports[`<AboutRoute /> renders 1`] = `
</title>
</HelmetWrapper>
<p>
Produced with ❤️
Produced with
&nbsp;
<span
aria-label="heart"
role="img"
>
❤️
</span>
</p>
<p>
View our contributors list on our
&nbsp;
<a
href="https://github.com/ctrlplusb/react-universally"
>
GitHub
</a>
&nbsp;
page.
</p>
</div>
Expand Down