Skip to content

youli homework#5

Open
youlixiao wants to merge 4 commits intoclonn:masterfrom
youlixiao:master
Open

youli homework#5
youlixiao wants to merge 4 commits intoclonn:masterfrom
youlixiao:master

Conversation

@youlixiao
Copy link

No description provided.

Copy link
Owner

@clonn clonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有試著將其他參考範例加進來, tab 還蠻不錯的用法,
記得要設定一下 tab 縮排的部分,以免讓 review 的人覺得格式差異太大

@@ -0,0 +1,17 @@
import React from "react";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊的 react 是沒有用到的,可以不需要

Copy link
Author

@youlixiao youlixiao Jun 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是喔 我去試試看
可是我剛試著去拿掉會出錯

TabsControl,
Tab,

}; No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊的排版明顯與上面的縮排不同,請採用統一格式,
1tab = 4space || 2space

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,我去看一下排版狀況

@@ -0,0 +1,47 @@
import React from "react";
var createReactClass = require('create-react-class');
let TabsControl = createReactClass({
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不確定為何要使用 createReactClass 這樣的套件?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

沒有用createReactClass 下面在建立會失效

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改好了
不過因為那是用套件
所以其他地方也要更改

this.setState({
"todos": todos,
"omdblist": OmDb.Search
})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以改寫如下,

const { Search: omdblist} = await api.reloadOmDbApi();
// 接下來就可以直接,

this.setState({
  todos,
  omdblist
});

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的 立馬來嘗試

}
});

let Tab = createReactClass({
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

現在可以直接採用

let Tab = () => {
  render ....
}
module.exports = {
   ...
   Tab
}

這樣是可以不用用到 createReactClass, 可以試試看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants