CodeAnt AI home pagelight logodark logo
  • Support
  • Dashboard
  • Dashboard
Documentation
API Reference
Start Here
  • What is CodeAnt?
  • Join Community
Setup
  • Github
  • Bitbucket
  • Gitlab
  • Azure Devops
Pull Request Review
  • Features
  • Customize Review
  • Quality Gates
  • Integrations
Scan center
  • Code Security
  • Code Quality
  • Cloud Security
  • Engineering Productivity
Integrations
  • Jira
  • Test Coverage
  • CI/CD
IDE
  • Setup
  • Review
  • Enhancements
Rule Reference
  • Compliance
  • Anti-Patterns
  • Code Governance
  • Infrastructure Security Database
  • Application Security Database
    • Apex
    • Bash
    • C
    • Clojure
    • Cpp
    • Csharp
    • Dockerfile
    • Elixir
    • Fingerprints
    • Generic
    • Go
    • Html
    • Java
    • Javascript
    • Json
    • Kotlin
    • Ocaml
    • Php
    • Problem-based-packs
    • Python
    • Ruby
    • Rust
    • Scala
    • Solidity
    • Swift
    • Terraform
    • Typescript
      • Angular
      • Aws-cdk
      • Lang
      • Nestjs
      • Nextjs
      • React
        • Best practice
        • Portability
        • React-create-element-dangerouslysetinnerhtml-prop
        • React-create-element-dangerouslysetinnerhtml-url
        • React-create-element-href-prop
        • React-create-element-href-url
        • React-dangerouslysetinnerhtml-prop
        • React-dangerouslysetinnerhtml-url
        • React-href-prop
        • React-href-url
        • React-refs-prop
        • React-refs-url
        • Security
        • Security
      • Typescript
    • Yaml
Resources
  • Open Source
  • Blogs
React

Best practice

react-legacy-component

Legacy component lifecycle was detected - $METHOD.

react-props-in-state

Copying a prop into state in React — this is bad practice as all updates to it are ignored. Instead, read props directly in your component and avoid copying props into state.

react-props-spreading

It’s best practice to explicitly pass props to an HTML component rather than use the spread operator. The spread operator risks passing invalid HTML props to an HTML element, which can cause console warnings or worse, give malicious actors a way to inject unexpected attributes.

react-find-dom

findDOMNode is an escape hatch used to access the underlying DOM node. In most cases, use of this escape hatch is discouraged because it pierces the component abstraction.

define-styled-components-on-module-level

By declaring a styled component inside the render method of a react component, you are dynamically creating a new component on every render. This means that React will have to discard and re-calculate that part of the DOM subtree on each subsequent render, instead of just calculating the difference of what changed between them. This leads to performance bottlenecks and unpredictable behavior.
React nextjs router refsI18next
twitterlinkedin
Powered by Mintlify
Assistant
Responses are generated using AI and may contain mistakes.