☀ ️ preface
You can find a lot of Code Review practices, Code Review procedures, how to Code Review, etc. It seems that there are not many actual review records, and I happen to be lucky enough to be the leader of the front-end team, so I usually go to secretly see what excellent code everyone has written. So today by the younger brother I, to share with you, small factory front line usually write code 😸
The author’s ability is limited, the comments inside may not be very correct, just make a record, throw a brick to attract jade, for learning reference ~
Project Background:
- The react 16.8 +
- antd@4
💻 Talk is cheap. Show me the code!
location.replace
和 location.href
Differences in the use of
The regular judgment does not escape special symbols that the user might enter
This component is intended to highlight keywords in a string of characters. Some characters in regular expressions have special meanings. If the original meanings are used in matching, they need to be escaped (preceded by \). *.? + $^ [] () {} | \ /
Table row click event handling
The sample code here wants to jump to the page by clicking on a table row, but it overwrites some mouse actions
Within a larger component, you need to be aware of rerendering issues caused by input components
Avoid using counterintuitive coding
Do the default processing for routing string concatenation
The native test code was not restored
Resolution: some mock code from the local runtime that was posted online and forgotten to restore
Maintain common components within the project
👋 is at the end
The overall content of this article is a little scattered, for students who have no foundation may not be too friendly, but if you feel that you have gained something after reading, you can leave a comment like! Later I will continue to take time to record, strive for a series of articles ~