Skip to content
Closed
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
4 changes: 2 additions & 2 deletions fixtures/dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
},
"scripts": {
"dev": "react-scripts start",
"predev": "cp -a ../../build/oss-experimental/. node_modules",
"build": "react-scripts build && cp build/index.html build/200.html",
"predev": "xcopy /E /I /Y ..\\..\\build\\oss-experimental\\* node_modules\\",
"build": "react-scripts build && copy build\\index.html build\\200.html",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
Expand Down
20 changes: 14 additions & 6 deletions fixtures/dom/src/components/IssueList.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const React = window.React;
import PropTypes from 'prop-types';

function csv(string) {
return string.split(/\s*,\s*/);
Expand All @@ -13,14 +14,21 @@ export default function IssueList({issues}) {
issues = csv(issues);
}

let links = issues.reduce((memo, issue, i) => {
return memo.concat(
i > 0 && i < issues.length ? ', ' : null,
<a href={'https://github.com/facebook/react/issues/' + issue} key={issue}>
let links = issues.map((issue, i) => (
<React.Fragment key={issue}>
{i > 0 ? ', ' : ''}
<a href={`https://github.com/facebook/react/issues/${issue}`}>
{issue}
</a>
);
}, []);
</React.Fragment>
));

return <span>{links}</span>;
}

IssueList.propTypes = {
issues: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.string),
PropTypes.string,
]),
};