简体   繁体   中英

React native use latest commit on master for a dependency

I want this fix for react-native-art/art crashing on (void)setShadow:(ARTShadow)shadow . But there has been no public release after v1.2.0 to include this fix. I have confirmed the fix works by manually adding the diff. But this is not a long-term solution. Does react-native support defining dependencies via branch and commit instead of version tags?

Currently, the dependency is defined like this:

{
...
"dependencies": {
    ...
    "@react-native-community/art": "1.2.0",
    ...
}
...
}

It's not really related to react-native , but to how npm dependencies get installed.

Using git URLs is supported so you can point dependencies to any repo, and if necessary to specific branches or even specific commits.

If you want to get whatever's on master you can set your dependency like so:

"@react-native-community/art": "git+https://github.com/react-native-art/art.git"

You can see the full npm documentation regarding Github URLs here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM