dozoisch / dozoisch/react-async-script

Any chance you could post a Stripe example?

オープン
#20 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
177
フォーク
29
PR マージ指標
30日以内にマージされた PR はありません

説明

I'm a bit confused on the examples.

I created a `Stripe.jsx` file:
```js
import React, { Component } from 'react'
import makeAsyncScriptLoader from 'react-async-script'

class Stripe extends Component {
constructor () {
super()
this.state = {
message: 'INIT...'
}
}
stripeJSLoaded (msg) {
console.info('loaded.')
this.setState({ message: 'Loaded.' })
}
render () {
return (

{this.state.message}

)
}
}

const callbackName = 'stripeJSLoaded'
const URL = 'https://js.stripe.com/v3/'
const globalName = 'stripe'

export default makeAsyncScriptLoader(Stripe, URL, {
callbackName,
globalName
})
```

Within the `App.jsx` I'm loading it:
```js
import Stripe from './Stripe'
...
onLoad () {
console.log('script loaded')
}
...
```
and rendering it:
```

```

I get 'INIT...' on the screen, but _nothing_ in the console or elsewhere.

At this point I'm just trying to get ANYTHING to load and then change some status to let me know it did it, let alone using that script.

Help?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、既存の例と、issue で説明されている Stripe.jsx および App.jsx のスニペットを確認します。非同期スクリプトローダーが load callback と global をどのように公開しているかを確認し、読み込みに成功したことを目に見える形で報告し、必要な App.jsx の配線を説明する、動作する Stripe の例を提供します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, react
領域
documentation, frontend
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。