score:1
i've investigated almost any react native solution for playing audio and various approaches of using javascript settimeout()/setinterval(), but none of them were satisfactory in terms of time stability and accuracy.
probably the only way to go at the moment is to glue some native module like this: https://developer.apple.com/library/content/samplecode/hellometronome/introduction/intro.html to js side, as described in rn docs: https://facebook.github.io/react-native/docs/native-modules-ios.html, which gives a pretty decent result, but unfortunately, it's ios only, of course.
score:7
the delay that you configure for settimeout
and setinterval
should never be thought of as an exact delay time. they represent the "minimum" amount of time that you'll wait before the function is executed. this is because the user-agent places the callback into the event queue when the time has elapsed, but if the user-agent is still working on some other task, the callback will sit there.
you should also know that there is a built-in absolute minimum time that you are never going to be able to go under of roughly 9-14ms. this is due to the internals of the user-agent.
Source: stackoverflow.com
Related Query
- Accuracy of setTimeout in React Native
- What is the difference between React Native and React?
- Error Running React Native App From Terminal (iOS)
- React native text going off my screen, refusing to wrap. What to do?
- Get current scroll position of ScrollView in React Native
- React Native Responsive Font Size
- Make view 80% width of parent in React Native
- Image resizing in React Native
- React Native on Android failed to find Build Tools
- Simulate display: inline in React Native
- React Native Error - yarn' is not recognized as an internal or external command
- Can React Native apps be tested in a browser?
- Hiding the status bar with React Native
- How to detect when a React Native app is closed (not suspended)?
- What folders should be git ignored in React Native project?
- How do I exit/shut down a React Native app?
- New React Native project with old version of react native
- How do you make the ListHeaderComponent of a React Native FlatList sticky?
- Transparent overlay in React Native
- Why does React Native not offer a justify-self
- Can you use React Native to create a desktop application?
- GET with query string with Fetch in React Native
- React Native / Xcode Upgrade and now RCTConvert.h not found
- PhaseScriptExecution [CP-User] error in React Native
- React Native error: Element type is invalid: expected a string or a class/function but got: object
- useEffect not called in React Native when back to screen
- Does React Native have a 'Virtual DOM'?
- How to concatenate JSX components in React Native
- React native change listening port
- Change button style on press in React Native
More Query from same tag
- why the local host debugging still cross origin after using Http-proxy-middleware
- Error: [div] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>
- Slow performance react-use-gesture and react-spring
- npm material-ui-table-edit loader
- How to type useRef hook in Flow?
- How do I apply a URL in a string?
- change sound in react component
- spread props in react using typescript
- React.js passing => in props
- How to display a single product?
- How to fix this Error:Uncaught TypeError: Cannot read properties of undefined (reading 'params')
- Better way for writing the reducers?
- Map loop in JSX to generate dynamic table headers in React
- Is there a way to pass down props to a component implicitly?
- Testing async behavior in React with Axios and Jest
- Material-UI ripple/hover effect carrying over to newly mounted component
- Why is my data not displaying in the table in react
- D3 collapsible tree with React: not updating nodes
- React Bootstrap Form.Check with Formik
- Filter array and show results in React
- How to remove duplicate files when files are drag and drop in a react component using HTML drag and drop
- Alternate between user and computer turn (react.js card game)
- Opening new tab with url in react
- Update state after axios POST request
- react-bootstrap breadcrumb with react-router-dom
- Error: Cannot resolve module 'style-loader'
- How to handle the `onKeyPress` event in ReactJS?
- How can I add icons Fontawesome in react?
- How to Update my Todo using Redux and React
- setState for a 2 level nested array of object