Shop at Soko Janja for the best online shopping experience!

Ubrica has taken the initiative to bring about an effective way of improving the quality of healthcare in the community. By buying from SokoJanja, helps put money in the sellers pocket and they can…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Building Reusable Component in React Native

If you are new to React Native or just started using React Native then this article will be useful for you.

We will be covering following line items.

How do we create a Component?

Here is how we would be reusing the component we just built

You can see we are just using the control. But one thing you notice the control is kind of static what about I want the same control with different content. Let’s see that in next section when we learn about props.

So here we will use component with props and see how we pass the props.

As you can see I am passing the title that I need the component to render. Remember as and when you change the props respective component will be re-rendered.

Now since Blink component changes its state after 1 sec, Blink component will manage its own state to hide/show the text and we won’t be knowing about the state of component.

The usage will remain exactly like before.

In our class component we would define props like below

Add a comment

Related posts:

Top 5 Unique ICOs

The demand of ICO has seen a massive rise by each passing day since its inception in the year 2017. The admiration has touched the sky in the past six months with an unimaginable revenue generation…

Unfolding Queer India

The existence of Indian queer component of the desi societal machinery is as old as the country’s culture itself. It is not off the record that even today the majority from the Spectrum choose to…