Giter VIP home page Giter VIP logo

Comments (6)

YA9 avatar YA9 commented on August 17, 2024 21

Here are step by step instructions for anyone interested

Step 1: Open the Files

You'll need to make changes to the following files within the react-native-snap-carousel package inside your node_modules folder:

  • Carousel.js
  • Pagination.js
  • PaginationDot.js
  • ParallaxImage.js

Step 2: Modify Carousel.js

Open Carousel.js and make the following changes:

  • Remove ViewPropTypes from the import statement at the top.
  • Replace ViewPropTypes ? ViewPropTypes.style : View.propTypes.style with PropTypes.oneOfType([PropTypes.object, PropTypes.array]) in three places.
  • Comment out the warning related to ViewPropTypes.

Step 3: Modify Pagination.js

Open Pagination.js and make the following changes:

  • Remove ViewPropTypes from the import statement at the top.
  • Replace all instances of ViewPropTypes ? ViewPropTypes.style : View.propTypes.style with PropTypes.oneOfType([PropTypes.object, PropTypes.array]).

Step 4: Modify PaginationDot.js

Open PaginationDot.js and make the following changes:

  • Remove ViewPropTypes from the import statement at the top.
  • Replace all instances of ViewPropTypes ? ViewPropTypes.style : View.propTypes.style with PropTypes.oneOfType([PropTypes.object, PropTypes.array]).

Step 5: Modify ParallaxImage.js

Open ParallaxImage.js and make the following changes:

  • Remove ViewPropTypes from the import statement at the top.
  • Replace the instance of ViewPropTypes ? ViewPropTypes.style : View.propTypes.style with PropTypes.oneOfType([PropTypes.object, PropTypes.array]).

Step 6: Create the Patch

After making the above changes, navigate to the root of your project and run the following command:

npx patch-package react-native-snap-carousel

This will create a .patch file in a directory called patches at the root of your project.

Step 7: Modify package.json

Add the following line to the scripts section in your package.json file:

"postinstall": "patch-package"

Step 8: Commit the Patch File

Commit the .patch file to your version control system (e.g., Git) so that other developers working on the project can benefit from the patch.

Step 9: Reinstall the Dependencies (Optional)

Run npm install or yarn to ensure the patch is applied.

from react-native-snap-carousel.

Ibadmoin avatar Ibadmoin commented on August 17, 2024 1

@YA9 @mahesh-agrawal-616 i did exactly what u said

image

image

Please help me out..

Hi Dear!

To resolve this issue, you need to install patch-package either globally or as a project dependency.

Option 1: Install patch-package globally

npm install -g patch-package

Option 2: Install patch-package as a project dependency

npm install --save-dev patch-package

Once you have installed patch-package, you can try running npm install again.

After these steps, running npm install should execute the postinstall script and apply any necessary patches. If the issue persists, you can try running patch-package directly:

npx patch-package

from react-native-snap-carousel.

devguerreiro avatar devguerreiro commented on August 17, 2024

Same problem here

from react-native-snap-carousel.

Gourav2609 avatar Gourav2609 commented on August 17, 2024

@YA9 @mahesh-agrawal-616 i did exactly what u said

image

image

Please help me out..

from react-native-snap-carousel.

Thilinalak avatar Thilinalak commented on August 17, 2024

Here are step by step instructions for anyone interested

Step 1: Open the Files

You'll need to make changes to the following files within the react-native-snap-carousel package inside your node_modules folder:

  • Carousel.js
  • Pagination.js
  • PaginationDot.js
  • ParallaxImage.js

Step 2: Modify Carousel.js

Open Carousel.js and make the following changes:

  • Remove ViewPropTypes from the import statement at the top.
  • Replace ViewPropTypes ? ViewPropTypes.style : View.propTypes.style with PropTypes.oneOfType([PropTypes.object, PropTypes.array]) in three places.
  • Comment out the warning related to ViewPropTypes.

Step 3: Modify Pagination.js

Open Pagination.js and make the following changes:

  • Remove ViewPropTypes from the import statement at the top.
  • Replace all instances of ViewPropTypes ? ViewPropTypes.style : View.propTypes.style with PropTypes.oneOfType([PropTypes.object, PropTypes.array]).

Step 4: Modify PaginationDot.js

Open PaginationDot.js and make the following changes:

  • Remove ViewPropTypes from the import statement at the top.
  • Replace all instances of ViewPropTypes ? ViewPropTypes.style : View.propTypes.style with PropTypes.oneOfType([PropTypes.object, PropTypes.array]).

Step 5: Modify ParallaxImage.js

Open ParallaxImage.js and make the following changes:

  • Remove ViewPropTypes from the import statement at the top.
  • Replace the instance of ViewPropTypes ? ViewPropTypes.style : View.propTypes.style with PropTypes.oneOfType([PropTypes.object, PropTypes.array]).

Step 6: Create the Patch

After making the above changes, navigate to the root of your project and run the following command:

npx patch-package react-native-snap-carousel

This will create a .patch file in a directory called patches at the root of your project.

Step 7: Modify package.json

Add the following line to the scripts section in your package.json file:

"postinstall": "patch-package"

Step 8: Commit the Patch File

Commit the .patch file to your version control system (e.g., Git) so that other developers working on the project can benefit from the patch.

Step 9: Reinstall the Dependencies (Optional)

Run npm install or yarn to ensure the patch is applied.

this worked to me. RN 0.69.12 node v18. thank you.

from react-native-snap-carousel.

belle-beauty avatar belle-beauty commented on August 17, 2024

Here are step by step instructions for anyone interested

Step 1: Open the Files

You'll need to make changes to the following files within the react-native-snap-carousel package inside your node_modules folder:

  • Carousel.js
  • Pagination.js
  • PaginationDot.js
  • ParallaxImage.js

Step 2: Modify Carousel.js

Open Carousel.js and make the following changes:

  • Remove ViewPropTypes from the import statement at the top.
  • Replace ViewPropTypes ? ViewPropTypes.style : View.propTypes.style with PropTypes.oneOfType([PropTypes.object, PropTypes.array]) in three places.
  • Comment out the warning related to ViewPropTypes.

Step 3: Modify Pagination.js

Open Pagination.js and make the following changes:

  • Remove ViewPropTypes from the import statement at the top.
  • Replace all instances of ViewPropTypes ? ViewPropTypes.style : View.propTypes.style with PropTypes.oneOfType([PropTypes.object, PropTypes.array]).

Step 4: Modify PaginationDot.js

Open PaginationDot.js and make the following changes:

  • Remove ViewPropTypes from the import statement at the top.
  • Replace all instances of ViewPropTypes ? ViewPropTypes.style : View.propTypes.style with PropTypes.oneOfType([PropTypes.object, PropTypes.array]).

Step 5: Modify ParallaxImage.js

Open ParallaxImage.js and make the following changes:

  • Remove ViewPropTypes from the import statement at the top.
  • Replace the instance of ViewPropTypes ? ViewPropTypes.style : View.propTypes.style with PropTypes.oneOfType([PropTypes.object, PropTypes.array]).

Step 6: Create the Patch

After making the above changes, navigate to the root of your project and run the following command:

npx patch-package react-native-snap-carousel

This will create a .patch file in a directory called patches at the root of your project.

Step 7: Modify package.json

Add the following line to the scripts section in your package.json file:

"postinstall": "patch-package"

Step 8: Commit the Patch File

Commit the .patch file to your version control system (e.g., Git) so that other developers working on the project can benefit from the patch.

Step 9: Reinstall the Dependencies (Optional)

Run npm install or yarn to ensure the patch is applied.

This fixed my issue!!!

from react-native-snap-carousel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.