r/AskProgramming • • Apr 17 '26

Why can't I understand React?

I’m comfortable with JavaScript fundamentals, but when I try to learn React, things start feeling confusing.

Concepts like state, props, hooks, and the overall way React structures code feel very different from how I normally think in JavaScript. Sometimes I understand the syntax, but I don’t fully get why things are done that way.

Has anyone else experienced this? How did you bridge the gap between knowing JavaScript and actually understanding React?

3 Upvotes

22 comments sorted by

View all comments

Show parent comment

2

u/Lumethys Apr 17 '26

React has a lot of weird implementations and tech debt accumulated in a messy ways. So not only you are learn the reactive paradigm, you are learn react's weirdness.

I usually recommend learning the easier framework first, like Vuejs or Svelte. When you "get" reactive programming, they React or Vue or Svelte is just different flavor. But to get there, Vue or Svelte would be an easier way to "get" reactive programming first.

For example, here's a simple component in VueJs:

<script setup>
  const normalVariable = 1;
  const reactiveVariable = ref(1);

  const readonlyDependentVariable = computed(() => reactiveVariable.value + normalVariable)
</script>

changing normalVariable will not affect readonlyDependentVariable, but changing reactiveVariable will, because it is a ref(), Vue automatically track the ref(), and its dependent values, and only update those values if the ref() change