Getting Started with React Native

Getting Started with React Native

My journey into React Native development, building a Pigpen cipher app from idea to implementation. Learn about the challenges and solutions when working with SVGs in React Native.

โ€ข By Ehsan Pourhadi โ€ข
Mobile Development React Native

Iโ€™ve been using React for years, but somehow never touched React Native. No reason โ€” just never had a project idea. Then one day I saw a random Reddit post about the Pigpen cipher (yep, that funky symbol-based code thing ๐Ÿ•ต๏ธโ€โ™‚๏ธ), and suddenly I was like:

โ€œWaitโ€ฆ what if I turned this into an app so I can send secret messages to friends?โ€

And thatโ€™s how the chaos began.

Pigpen cipher key diagram The classic Pigpen cipher key โ€” letters turned into secret symbols


Discovering Expo ๐Ÿš€

After a quick Google dive, I found Expo โ€” basically React Nativeโ€™s best friend. It sets up everything for you, zero config.

I ran:

npm install -g expo-cli
expo init Pigpen-cipher
expo start --web

Boom. Instant app with working tabs. One for encrypting, one for decrypting. I could even preview it in my browser โ€” felt like magic.


The SVG Meltdown ๐ŸŽจ๐Ÿ’€

Then I tested it on iOS andโ€ฆ my SVG symbols were gone. Poof. Hours of Googling later, I tried different libraries, converted all my SVGs into React components, and still โ€” nothing. Turns out, I just forgot to set width and height on each SVG. ๐Ÿ˜ญ

_That โ€œohhhhโ€ moment when the bug finally makes sense ๐Ÿ˜…_

Success! ๐ŸŽ‰

Once I fixed that, everything worked perfectly. You could tap the symbols to decrypt messages or type and encrypt text back into Pigpen symbols.

Next on the list: let users save their secret message as an image to share.


Whatโ€™s Next

Pushed everything to GitHub (because of course ๐Ÿ˜Ž): ๐Ÿ‘‰ Pigpen Cipher App on GitHub

My plan:

  • Use react-native-view-shot to convert the screen to an image
  • Use react-native-cameraroll to save it locally

Basically, turning secret code into shareable art.


Key Takeaways ๐Ÿ’ก

  1. Expo is amazing โ€” zero setup, instant app.
  2. SVGs need explicit width & height (learned that the hard way).
  3. Test on real devices, not just web.
  4. Sometimes the โ€œbugโ€ is justโ€ฆ you. ๐Ÿ˜…

If youโ€™re new to React Native โ€” start with Expo, mess around, break stuff, fix it, and repeat. Youโ€™ll learn so fast.


Wanna try decoding your own messages? Check out the GitHub repo and send me your secret notes ๐Ÿ•ถ๏ธ

Tags: #React Native #Expo #Mobile #JavaScript #SVG
TreeStone
Running cat