mirror of
https://github.com/wassname/talk.git
synced 2026-08-18 12:30:39 +08:00
Give descriptive key for slot elements and use it instead of talkPluginName
This commit is contained in:
@@ -14,10 +14,10 @@ import cn from 'classnames';
|
||||
|
||||
class Settings extends React.Component {
|
||||
childFactory = el => {
|
||||
const pluginName = el.type.talkPluginName;
|
||||
const key = el.key;
|
||||
const props = {
|
||||
indicateOn: () => this.props.indicateOn(pluginName),
|
||||
indicateOff: () => this.props.indicateOff(pluginName),
|
||||
indicateOn: () => this.props.indicateOn(key),
|
||||
indicateOff: () => this.props.indicateOff(key),
|
||||
};
|
||||
return React.cloneElement(el, props);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user