import React, { useState } from 'react'; import Select from 'react-dropdown-select'; //DOCS: props.uri is the address of a live news-server //DOCS: props.newsKey is the key of the live news-server const NewsEditor = props => { let titleElement, authorElement, bodyElement; const [articles, setArticles] = useState(null); const [index, setIndex] = useState(null); if (!articles) { fetch(`${props.uri}/titles?limit=999`, { method: 'GET', headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' }, }) .then(a => { if (!a.ok) { throw `Network error ${a.status}: ${a.statusText} ${a.url}`; } return a.json(); }) .then(a => setArticles(a)) .catch(e => console.error(e)) ; } return (

News Editor

titleElement = e } />
authorElement = e } />