Currently I'm trying to add snapchat to a site through their SDK
my current attempt, can't figure out how to convert their Dom script into a function to be called when my component is loaded:
export function snapchatSDK() {
return new Promise(resolve => {
const script = document.createElement('script');
script.src = 'https://sdk.snapkit.com/js/v1/create.js';
document.head.append(script);
});
}
class Platforms extends React.Component {
componentDidMount() {
snapchatSDK();
}
render() {
return (
<div>
<p> Share on Social Media Platforms</p>
<h4>Snapchat<h4>
<button
className="snapchat-creative-kit-share"
data-share-url= urlTobeShared()
>
Share me
</button>
<h4>Twitter<h4>
<button>
Share me
</button>
<h4>Reddit<h4>
<button>
Share me
</button>
</div>
);
}
}
Here is a link to the doc's as well: snap doc