Extract complex inline code elements into separate functions, components, or constants to improve readability and maintainability. This includes hardcoded strings, complex event handlers, and lengthy JSX expressions.

Examples of what to extract:

// Instead of inline handler:
onClick={(e) => {
  props.onClick(e, props.item)
  onClick(e, props.item)
}}

// Extract to function:
function handleClick(e) {
  props.onClick(e, props.item)
  if (props.item.onClick) {
    props.item.onClick(e, props.item)
  }
}

This practice makes code more testable, reusable, and easier to understand by giving meaningful names to code blocks and reducing visual complexity in the main component logic.