react-native-swiper icon indicating copy to clipboard operation
react-native-swiper copied to clipboard

Text strings must be rendered within a <Text> component

Open sintylapse opened this issue 5 years ago • 13 comments
trafficstars

If you pass children with prop title inside Swiper you will get this error Text strings must be rendered within a <Text> component. That because of this terrible line of code https://github.com/leecade/react-native-swiper/blob/master/src/index.js#L702

It is just so wrong solution to reserve prop title for a package assuming that people are not using prop title in items that they pass to to the package, because this is very common property name to use.

I face this crash once a half of year and every time forget about this terribly written line of code. Leaving this issue here in case I forget again, of anyone else face it

sintylapse avatar Nov 25 '19 19:11 sintylapse

Just saved my ass. Thank you for this 👍

ananeto48 avatar Jan 16 '20 18:01 ananeto48

Likewise. Have spent the last hour wondering why my code only started breaking because I changed the structure of the types. Thankyou!

tomasswood avatar Feb 13 '20 02:02 tomasswood

Thanks @sintylapse !

You shouldn't have close the issue, it need a PR :)

martinfrouin avatar Mar 17 '20 09:03 martinfrouin

Thank you so much! :)

shaunakk avatar Mar 23 '20 04:03 shaunakk

Seriously this issue is so weird, so Changing the title prop name solved the issue. Why is that?

muxbert avatar Apr 01 '20 14:04 muxbert

this issue still exists, @sintylapse i think its better to re-open this, because i think a lot of people face the same issue and waste a lot of time without even knowing what it is. For me, a single child with prop "title" is not giving any issue, but multiple children with prop "title" is throwing this error. Fixing this issue, or atleast keeping it open would be helpful, i guess (y)

JayantJoseph avatar Jun 23 '20 11:06 JayantJoseph

@JayantJoseph sure

sintylapse avatar Jun 23 '20 11:06 sintylapse

Thanks from Brazil. Took me a good 30 minutes to find this one.

hooksoft avatar Jul 17 '20 14:07 hooksoft

OMG, thx for that bro

brenobarnard avatar Nov 18 '20 02:11 brenobarnard

Thank you for saved my debugging time

davidwico avatar Mar 01 '21 16:03 davidwico

Cheers mate! You save my day.

GankCC avatar Jun 09 '23 07:06 GankCC

Thanks for saving my time 🫶🏻

xafm avatar Jun 17 '23 12:06 xafm

@sintylapse Thanks a lott for saving my ass😥 have been wondering over this issue for the past two days.

theDevSoham avatar Jan 04 '24 02:01 theDevSoham