mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 10:45:55 +08:00
Plugins can trigger own actions with core reducers
This commit is contained in:
@@ -3,9 +3,10 @@ import {importer as injectPlugins} from 'coral-framework/helpers/importer';
|
||||
|
||||
class Slot extends Component {
|
||||
render() {
|
||||
const {pluginProps: actions, ...props} = this.props;
|
||||
return (
|
||||
<div>
|
||||
{injectPlugins(this.props)}
|
||||
{injectPlugins({...props, actions})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@ import styles from './style.css';
|
||||
|
||||
export default (props) => (
|
||||
<div className={styles.Respect} key={props.key}>
|
||||
<button onClick={props.pluginProps.clickButton}>Respect</button>
|
||||
{console.log(props)}
|
||||
<button onClick={props.actions.clickButton}>Respect</button>
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user