0
次のコードは、ブラウザのコンソールまたはwebpack開発サーバーコンソールに表示されないShowビューを空白(完全に白色)にします。プロキシアクションにクラス定義コンポーネントが設定されていると、表示が暗黙に失敗する
const actionStyle = {
zIndex: 2,
display: 'inline-block',
float: 'right',
};
class ActionButtons extends React.Component{
render(){
const {basePath, data, refresh} = this.props;
return (
<CardActions style={actionStyle}>
<FlatButton secondary label="Process" icon={<ProcessIcon />} />
<ListButton basePath={basePath} record={data} />
<FlatButton primary label="Refresh" onClick={refresh} icon={<RefreshIcon />} />
</CardActions>
);
}
}
const ShowContactRequest = (props) => (
<Show title={<RecordTitle />} actions={<ActionButtons />} {...props}>
<SomeOtherComponentImportedFromSomeWhere />
</Show>
);
コンポーネントActionButtons
がフラット機能で提供されている場合、表示ビューは問題なく動作します。
私はreduxストアにアクセスできるように、クラスとしてアクションコンポーネントを作成する必要があります。
私は間違って何をしているのか?
ありがとうございました。
このファイルから何をエクスポートしていますか?現在のコードはうまくいくようです。 –
問題が見つかりました。コンポーネントを正しくエクスポートしていませんでした。今修正しました。 –