dualn_back's People
dualn_back's Issues
Small fixes
- .eslintrc is empty, so can be deleted
- .prettierrc.js can be deleted since it duplicates rules from ESLint
- Do we actually need App.js file since it is just a Root inside? Maybe better use Root directly in index.js?
- Better avoid comments in Russian in the code. You never know who'll read it later ๐
- Prefer using exact objects for Flow types
- Optionally you can move Navigator to a separate component. It's up to you, because here it's the only one, so it won't add much here, but for other projects it can be helpful, because you split the navigation from the other logic
- For
useState
you added types like this:const [mistakes: number, setMistakes] = useState(0);
. Not sure if it works correctly, but anyway better use the approach with generic:const [mistakes, setMistakes] = useState<number>(0)
. In this case Flow will automatically get correct types both for the value and for the setter - Better add Flow annotation to the styles files. In this case Flow will get their type after importing
- That's really great that you used React Navigation v.5.0. You can go even further and for function components use
navigation
not from the prop which we get from the HOC, but useuseNavigation
hook instead. In this case the props will take only parents' props which can make the code more clear - In Session/index.js you can omit
else
case since it's redundant - Better avoid using
do ... while
loops like you did inanswersIndexes
since they are less readable and always can be replaced with regularwhile
,for
or functions likemap
orforEach
- When you want to check if some element exists in the array, it's better to use
includes
instead ofindexOf
as you did inanswersIndexes
Refinement tips
-
Seems like you need to move ESLint config from
.eslintrc
to.eslintrc.js
, otherwise it will not be used. See https://eslint.org/docs/user-guide/configuring#configuration-file-formats. Also better fix all ESLint warnings and errors. -
Using Props in
src/containers/Results/utils.js
is a bit misleading, probably better to type-hint the arguments themselves, but it's up to you. -
Better remove all commented and redundant code e.g. commented styles for button in
src/containers/Results/styles.js
, the files with reducer and actions for Results container, newline in the middle ofsrc/containers/Session/components/PositionedSquare/styles.js
.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.