Skip to content
Advertisement

Tag: react-native

How to stop swipe in ScrollView?

look this video of current scrolling behavior. i want, as soon as finger is lifted from screen, to disable scrolling. Edit: the video shows a user scrolling through a list. When the finger is lifted from the screen, you see the scrolling continues up or down for a short time. Answer I think what you need is: This way when

Rendering heavy SVG files (improving performance)

In our company we want to come up with universal solution for creating interactive presentations as mobile applications. First idea was to create a PDF file and use it in mobile phone, it didn’t work out – it was too slow. Another idea was to convert PDF into SVGs and use them as scenes (slides) and that’s what I am

Detect swipe left in React Native

How can I detect a left swipe on the entire screen in React Native? Would it be necessary to use PanResponder or can it be done a little more easy? Answer There is an existing component react-native-swipe-gestures for handling swipe gestures in up, down, left and right direction, see https://github.com/glepur/react-native-swipe-gestures

eslint Parsing error: Unexpected token =

Why is eslint throwing this error? The Javascript runs without issue inside of React Native. The code was taken from the react-navigation example at : https://reactnavigation.org/docs/intro/ Javascript: eslint error: .eslintrc.js file: Answer The syntax is not yet standardised, but a stage-2 proposal for inclusion in Javascript (see “Class Fields” on https://github.com/tc39/proposals). Try adding the following option above “extends” in your

How to mock Push notification native module in React native jest tests?

When using the module react-native-push-notification, I had this error: I tried to mock the module by creating __mocks__/react-native.js and putting this code within it: Now, I have this error: How I could mock fully this module the right way? Answer I mocked the module PushNotificationIOS by creating a setup file jest/setup.js: I’ve configured jest to run this setup file by

Advertisement