DEV Community

Chandrasekar Kuppusamy
Chandrasekar Kuppusamy

Posted on • Originally published at Medium on

Props and State in React Native

What is Props?

Props can be referred to something that can be changed dynamically in a Component (i.e Ideally, passing parameters through constructor in JAVA). Let’s discuss more on this by comparing JAVA with React Native.

Code Usage:

  1. Destination Class: (Class which receives props data)

2. Source Class: (Class which sends props data)

What is State?

State is nothing but a triggering method which is used to refresh or update values in the Component. Each time when ‘ setState ’ is called, the render() function in a Component will be called simultaneously.

Code usage:

The above code snippet creates the Button component with the initial text as “ Failure ”, and the text is replaced to “ Success ” using ‘ setState ’ function when the button is clicked or pressed.

Top comments (0)

Image of Datadog

Keep your GPUs in check

This cheatsheet shows how to use Datadog’s NVIDIA DCGM and Triton integrations to track GPU health, resource usage, and model performance—helping you optimize AI workloads and avoid hardware bottlenecks.

Get the Cheatsheet

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay