credify-web-react
v0.4.0
Published
React specific wrapper for credify-web
Downloads
4
Readme
credify-web-react
This is a React package of Credify Web SDK.
How to use
$ npm install credify-web
$ npm install credify-web-react
First, you need to call defineCustomElements()
in your application.
/// index.ts or index.js
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
// Additional lines
import { applyPolyfills, defineCustomElements } from 'credify-web/loader';
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
// Additional lines
applyPolyfills().then(() => {
defineCustomElements();
});
Then, you can import React components like following.
import { CredifyModal } from 'credify-web-react';
const sample = () => {
return (
<div>
<CredifyModal></CredifyModal>
...
</div>
)
}
Note
When you distribute this SDK, you will need to remove the first line in components.d.ts.