What does it mean to be done declaratively?

I was reading the React “refs and the DOM” section. I don’t understand this line.
“Avoid using refs for anything that can be done declaratively”. can anyone explain what does this line mean?

Refs are sort of an anti-pattern in how UIs are supposed to be built in React.

  • Accessing the DOM element directly is not heavily smiled upon :frowning:
  • It is preferred to work with state and props and indirectly get your UI get updated :slight_smile:

Welcome to the forums @shahab570!