kirillzyusko/react-native-bundle-splitter

Add more code examples

kirillzyusko opened this issue · 4 comments

Is your feature request related to a problem? Please describe.

It's not a real problem of library itself. I would say it's more about documentation. Sometimes it's better to see real example, than reading a thousands line of text, so, please, add more real code examples.

Describe the solution you'd like

I would like to see next examples:

  • usage of preload API (component, group);
  • usage placeholder option;
  • tab/drawer examples;

Describe alternatives you've considered

I think it would be good to have all examples in one place (let's say in Example application) and at the same time have separate Snacks for each case (these snacks can be added to documentation).

I agree, I found the lib great, but I tried to use it in the RN with typescript I don't know if it worked or not

@Victorcassiano it also works in TS. Why do you have doubts that it doesn't work?

@Victorcassiano também funciona em TS. Por que você tem dúvidas de que não funciona?

That's where it is, I did the correct steps that the doc indicates, but it doesn't have a counter to know if it really worked or not.

to check I used this.

import { investigate } from 'react-native-bundle-splitter/dist/utils';
console.log('Bundle Info: ', investigate().loaded);

1992 appeared loaded, does that mean it worked?

@Victorcassiano try to wrap some of your screens in register HOC. After that check the output from the investigate function. If you did everything correctly, then you will not see your screens in loaded. If so, then everything works correctly :)