score:1
you're mounting veriff.mount() before the page is loaded so the root element cannot be found.
wrap it in a useeffect()
useeffect(() => {
veriff.mount()
return () => {
//then unmount
veriff.unmount()
}
// this renders once when there isn't an input
}, [])
should do the trick also, don't forget to
import react, {usestate, useeffect} from 'react'
score:0
you must to import veriff as named import
import {veriff} from "@veriff/js-sdk";
score:2
i've been messing with this for some time, and realized that the imported object import veriff from "@veriff/js-sdk
actually isn't a function, rather it's an object that contains a function. it returns {veriff:𝑓}
, so basically you need to call veriff.veriff(options)
instead of just veriff(options)
. for me, typescript did not allow this, so i had to do const veriff = require("@veriff/js-sdk)
instead of the es6 import. hope this helps someone and the veriff team refactor this either in the documentation or code.
Source: stackoverflow.com
Related Query
- Veriff integration into a react.js project
- Cant Import CSS files into React Project
- Module not found: Can't resolve '../images/bg-header-desktop.svg' when importing image into React project
- Error while trying to integrate React-DateRangePicker into React Project
- How do I implement SVG's into a React project (from Vanilla JS)
- Can't properly load typescript class into react project
- Dynamically Load Project Data from JSON file into React
- Incorrect integration into React props
- Why I my React Project goes into infinite loop and keep rendering pokemons on the window?
- Unexpected token "<" when importing from third party library into React project
- Importing react app into existing Webpack project
- How to pass in a react component into another react component to transclude the first component's content?
- Adding an .env file to React Project
- Getting "Cannot call a class as a function" in my React Project
- How is ESLint integrated into Create React App?
- loading json data from local file into React JS
- How do I load a markdown file into a react component?
- New React Native project with old version of react native
- Inserting the iframe into react component
- Material-UI's Tabs integration with react router 4?
- Call a static function into the class React ES6
- React project in Visual Studio 2017
- Ignore or prevent ESLint errors from breaking the build in a React project (create-react-project)
- React Native project do not have index.ios.js or index.android.js
- Is there a right way to pass data into a React component from the HTML page?
- How to upgrade a React project built with create-react-app to the next create-react-app version?
- React Native - npx react-native run-ios doesn't work after initializing the project
- When testing, code that causes React state updates should be wrapped into act
- What is the react-app-env.d.ts in a react typescript project for
- Passing props into external stylesheet in React Native?
More Query from same tag
- Changing style of a button on click
- How do I select/unselect in redux?
- Wordpress Gutenberg autocomplete - saving attributes
- react-particle-js not updating the number of particles
- Target container is not a DOM element.(Carousel using ant design in react js)
- Web: Perfectly center content in middle, but have a div on top that doesn't push content down
- sound cloud SC.stream api not working in react as wished
- Cookies don't get stored in localhost
- React Native (View config getter callback for component `input` must be a function (received `undefined`). Make sure to start component names with)
- HTTP request received with status 200 and without body
- Test class component firebase action with Jest
- How to get route params in React functional component
- componentWillUnmount & Warning: setState(...): error
- How to modify a complex JSON Object in using Immutable
- Deciding which redux container to make API calls from
- Center content and make their position adjustable
- React proxy uses the wrong url
- Unable to toggle a component for a second time using event listeners
- react-data-tables Undefined Toolbar
- How to remove subfolder name from Next Js URL?
- Resetting a Formik field array to an empty array prior to form submission
- React-Router Parsing error: Unexpected token
- Best practice for handling null prop when accessing prop attribute
- Invalid token, state does not match - Auth0 Error Safari only
- Unable to make react-player light prop always true
- How to add an object in reducer?
- How to set i18n default translation language in React
- map.getCenter and map.getBounds are not functions inside map.target.on('click') function
- Chosing first two from the array and the add +(plus) for rest of them
- How create a customize list item(li) inside a unorder list(ul) in reactjs