1

ウェブサイトのリンク: https://zen-stonebraker-8640d3.netlify.com/

何が問題なのかわかりません。サイトのリンクをクリックして見ても、Calendly がサイトに表示されていません。それが私のコードの問題なのか、それとも Netlify の展開の問題なのかはわかりません。ウィジェットは実稼働中にローカルホストに表示されますが、デプロイ中には表示されません。助けてください。

import React from 'react';

class Calendly extends React.Component {
  calendlyScriptSrc = 'https://assets.calendly.com/assets/external/widget.js';

  componentDidMount() {
    const head = document.querySelector('head');
    const script = document.createElement('script');
    script.setAttribute('src', this.calendlyScriptSrc);
    head.appendChild(script);
  }

  componentWillUnmount() {
    const head = document.querySelector('head');
    const script = document.querySelector('script');
    head.removeChild(script);
  }
  render() {
    return (
      <div id="schedule_form">
        <div
          className="calendly-inline-widget"
          data-url="https://calendly.com/handofgravity"
          style={{ minWidth: '480px', height: '640px' }}
        />
      </div>
    );
  }
}

export default Calendly;
4

2 に答える 2