humanmade / humanmade/react-oembed-container

Not working, no errors

Open
#12 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
44
Forks
12
PR merge metrics
No merged PRs in 30d

Description

I've tried to use the component and had no errors but it didn't work. Are you guys still maintaining this or I'm missing something?

Here's my component code:

```jsx
import React, { useState, useEffect, Suspense } from 'react';
import EmbedContainer from 'react-oembed-container';
import axios from '../../../../node_modules/axios/dist/axios.js';

const RealTime = () => {
const [content, setContent] = useState('');

useEffect(() => {
const options = {
url: wpApiSettings.root + 'wp/v2/custom-post-type/' + postTypeID,
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json;charset=UTF-8'
},
};

function requestPosts(options) {
axios(options).then( response => {
console.log( response );
setContent( response.data.content.rendered );
});
setTimeout(requestMoments, 20000, options);
};

requestPosts(options);
});

return (



)
}

export default RealTime;
```

Thanks in advance!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.