(реагировать JS) выборка не работает после развертывания gh-страниц - PullRequest
0 голосов
/ 13 марта 2020

При тестировании на локальном хосте все работало нормально

, но после развертывания gh-страниц "fetch" не смог получить файл уценки

Вот код

import Markdown from "react-markdown";
import source from './posts/2020-03-12-test.md';

export default class Notice extends React.Component {

    state = {
        post: null
    }

    componentDidMount() {
        fetch(source)
          .then(res => res.text())
          .then(post => this.setState((state) => ({ ...state, post })))
          .catch((err) => console.error(err));
      }

    render() {
        return (
                <Markdown
                    source={this.state.post}
                />
        );
    }
}

Localhost:

enter image description here

Ошибка на страницах GH:

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...