Some code paths are unreachable because the
continue statements unconditionally exit a block of code.
The code statements after the above keywords (which exit the code block) will not execute.
Using reserved prop-names like
style on custom components hurts readability, and makes the code harder to maintain. These props should only be used for DOM nodes like
.bind()or local functions in JSX properties JS-0417
.bind() or passing local callback functions as props to react component incurs a performance overhead.
React.useCallback, or if possible, moving the callback definition outside the component.
EXCEPTIONS: This rule may not apply if your react component is only rendered once, or if your application is not performance sensitive. In such cases, consider adding a skipcq to prevent DeepSource from raising this issue on a single component. Alternatively, for small applications, you could add this issue in the ignore rules section.
Note that the performance overhead is not determined by the size of the callback function, but instead the number of times the component is rendered.
componentDidMount() is invoked immediately after a component is mounted. This method is a good place to load data from an endpoint as it is invoked before the browser updates the screen.
componentDidMount() will trigger an extra rendering, so it causes performance issues as
render() will be called twice.
String#match should only be used when we need to use the parts of a string that match a specific pattern: