Skip to content
This repository was archived by the owner on Jan 16, 2023. It is now read-only.

Conversation

bkniffler
Copy link
Contributor

This is how I’d imagine a custom renderNode could be implemented. Its depending on my other PR. What do you think of something like that?

I had to move VelocityComponent to the toggle decorator.

only text

var renderNode = (props, toggle, decos, anim)=>{
   const {id, toggled, code, name, active} = props.node;
   return (
      <div onClick={toggle}> 
         <span>{name}</span>
      </div>
   )
};
<Treebeard renderNode={renderNode}/>

or with default decorators

var renderNode = (props, toggle, decos, anim)=>{
   const {id, toggled, code, name, style, active} = props.node;
   return (
      <div onClick={toggle}> 
         <decos.Toggle style={style.toggle} animations={anim.toggle} />
         <decos.Header node={props.node} style={style.header} />
      </div>
   )
};
<Treebeard renderNode={renderNode}/>

@alexcurtis alexcurtis closed this Dec 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants