aMarCruz / react-native-text-size

Measure text accurately before laying it out and get font information from your App.
BSD 2-Clause "Simplified" License
405 stars 95 forks source link

Can we implement auto-linking please? Here are the instructions: #43

Open benjaminharringtonrose opened 1 year ago

benjaminharringtonrose commented 1 year ago

It should be as easy as this: Add a new file called react-native.config.js

in that file, add:

module.exports = {
  dependency: {
    platforms: {
      android: {
        packageImportPath:
          "import com.github.amarcruz.rntextsize.RNTextSizePackage;",
        packageInstance: "new RNTextSizePackage()",
      },
      ios: {
        podspecPath: "ios/RNTextSize.podspec",
      },
    },
  },
};

And I'm pretty sure that's it. I can create a PR if you give me access! Thanks!

benjaminharringtonrose commented 1 year ago

Actually, you'll need to move your pod spec file to the root, and then change the podSpecPath to RNTextSize.podspec. I did it and created my own repo and it worked

mkultr4 commented 1 year ago

@benjaminharringtonrose can you provide an example how ?

benjaminharringtonrose commented 1 year ago

Yeah, go take a look at the repo on my GitHub!!!

mkultr4 commented 1 year ago

@benjaminharringtonrose can you explain how to install it in a native expo/react project?

Eden4897 commented 2 months ago

For anyone struggling, this fork here seems to work. (npm)