# Warning: componentWillMount has been renamed, and is not recommended for use.

**Code:** `componentWillMount renamed` · **Category:** React · **Seen on:** React

A class component uses legacy lifecycle methods (componentWillMount/WillReceiveProps/WillUpdate).

## Meaning

These lifecycles are unsafe for async rendering. React prints the warning with the component names.

## Common causes

- Old class components
- Outdated libraries

## Quick fix

1. Move logic to componentDidMount / getDerivedStateFromProps / componentDidUpdate
2. Upgrade libraries
3. Run npx react-codemod rename-unsafe-lifecycles as a stopgap

## Detailed fix by platform

### React

1. Convert to function components with useEffect where possible

## How to diagnose

1. **Components** — Which are listed?
2. **Recent change** — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/react/componentwillmount-has-been-renamed)
