0.1.10 • Published 2 years ago
woflow_test_sdk_v1_amazing v0.1.10
WOFLOW NPM FIRST TRY
HOW TO USE IT
npm i woflow_test_sdk_v1_amazing
import { Button , Badge, WoflowIframe } from 'woflow_test_sdk_v1_amazing';
<Button label="test" kind="primary"/>
<Badge value="BADGE FROM NPM"/>
<WoflowIframe />
// if you use <WoflowIframe /> , to receive the data in client
useEffect(() => {
window.addEventListener("message", function (e) {
if (e.origin !== "http://localhost:3002") return; // add your localhost
console.log(e.data.menu);
if(e.data.menu){
setRecievedMessage("Got this message from iframe npm: " + JSON.stringify(e.data));
}
else{
setRecievedMessage("Not data yet");
}
});
}, []);