# 2020-02-24 昨天會出現 Render 失敗是因為我少加了 setContainer 的關係,加上之後就正常了  ``` diff Configuration.initial(rawConfig).then((config) => { createDirectLine(config.directLineOptions).then((directLine) => { setConfig(config); SetDirectLine(directLine) }) }); + setContainer(document.getElementById('root')) ``` 再來是在 react 裡面用 window.WebChat ``` js const { ReactWebChat } = window.WebChat; return ( <ReactWebChat userID={userId} username={userName} locale={locale} className={`${className || ''} web-chat`} directLine={directLine} store={store} styleSet={this.createStyleSet(styleOptions)} activityMiddleware={this.activityMiddleware} /> ) ``` 直接這樣 render 是不行的,後來我試了 `window.WebChat.renderWebChat` 把他 render 在另一個 div 裡面可以
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up