Hello, everybody! My name is Perttu Lähtenalahti, and today I'm going to talk about how to build cross-platform component libraries for React and React Native. Before I dive into that subject, I just want to introduce myself briefly. My name, as mentioned, is Perttu Lähtenalahti. Don't worry, it's a really difficult one. I had it wrong once even in my passport. The reason for the difficult name is because I'm originally from Finland, currently living in beautiful Helsinki, Finland.
I have a website, perttu.dev. You can find this presentation as an article there. And a bunch of other stuff as well. You can also find me on GitHub and Twitter using this handle here. And the slides for this presentation, you can find them at this address. You can also find this project there. Which will allow you to test it out and build your own components using the way I'm going to show you. So, yeah. Let's dive into the subject of today's talk.
So, what this is going to be about is, of course, how to build cross platform components so that you can actually use them in both React and React Native projects. My idea is that the requirements for React Native knowledge are going to be pretty slim. Just knowing the basics of difference between React Native and React is supposed to be enough in this case and I hope that's going to be it. And using React Native, we're going to look into how to actually use that to build cross platform components that we can use on both web and native, in this case iOS and Android, and also how to build these platform specific components so that we can have the same components but the code being different between these two platforms. The reason for this, we're going to talk more later about it, but the basic idea is that we want to have a single code base and share as much code as possible. Towards the end of the talk, I'm going to dive a little bit into the styling and the pros and cons of this approach that I'm going to show you. Then, a few additional points. We're not going to use React Native web, which I think I'm going to mention soon, and we're also going to use styled components and storybook. For those who haven't used styled components, it's a really awesome CSS in JS solution that allows us to style our cloche platform components really easily in this case. Storybook is just something that I'm now using to show the components in a separate context from building a real application. So, yeah. This project or this approach that I'm going to show you is actually based on a customer approach that I did a little bit of time ago. So, that customer, I can't mention the name, but it was a big government-owned news organization and they actually had three React native apps and one web app that was powered by React. Basically their main website. And they were serving, I'd say, cloche, maybe even over a million people every day, so the user amounts were huge.
Comments