Skip to content
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
40 changes: 25 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "1.0.0",
"private": true,
"dependencies": {
"chai": "^4.2.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"classnames": "^2.2.6",
"enzyme": "^3.8.0",
"enzyme-adapter-react-16": "^1.7.1",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-scripts": "2.1.3",
"react-test-renderer": "^16.7.0"
"jshint": "^2.13.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
Expand All @@ -23,14 +23,24 @@
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": "react-app"
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"gh-pages": "^3.1.0"
}
Expand Down
1 change: 0 additions & 1 deletion src/Cell.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { Component } from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { timingSafeEqual } from 'crypto';

class Cell extends Component {
render() {
Expand Down
4 changes: 2 additions & 2 deletions src/GameOfLife.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ class GameOfLife extends Component {
if (this.state.populatedCells.includes(i)) {
props.populated = true;
}
cells.push(<Cell key={"cell-" + i} onClick={(() => {
cells.push(<Cell key={"cell-" + i} onClick={() => {
this.toggleCell(i);
}).bind(this)} {...props} />);
}} {...props} />);
}

const style = {
Expand Down
21 changes: 13 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOM from 'react-dom/client';
import './index.css';
import GameOfLife from './GameOfLife';
import * as serviceWorker from './serviceWorker';
import reportWebVitals from './reportWebVitals';

// const gliderPopulation = [[1, 0], [2, 1], [0, 2], [1, 2], [2, 2],]
const gliderPopulation = [[5, 1], [5, 2], [6, 1], [6, 2], [5, 11], [6, 11], [7, 11], [4, 12], [3, 13], [3, 14], [8, 12], [9, 13], [9, 14], [6, 15], [4, 16], [5, 17], [6, 17], [7, 17], [6, 18], [8, 16], [3, 21], [4, 21], [5, 21], [3, 22], [4, 22], [5, 22], [2, 23], [6, 23], [1, 25], [2, 25], [6, 25], [7, 25], [3, 35], [4, 35], [3, 36], [4, 36],]
ReactDOM.render(<GameOfLife
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<GameOfLife
width={40}
height={40}
startingPopulation={gliderPopulation}
start={true}
border='marquee'
cellWidth={10}
/>, document.getElementById('root'));
/>
</React.StrictMode>
);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: http://bit.ly/CRA-PWA
serviceWorker.unregister();
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
13 changes: 13 additions & 0 deletions src/reportWebVitals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};

export default reportWebVitals;
135 changes: 0 additions & 135 deletions src/serviceWorker.js

This file was deleted.

Loading