question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove hard coded label

See original GitHub issue

Hi, please, make hard coded ‘title’ and ‘subtitle’ changeable

For example:

<SortableTree
     title="label"
     subtitle="url"
     treeData={this.props.menu}
     onChange={ treeData => this.props.changeTree(treeData) }
/>

If this field are not fill used default params title=“title”, subtitle: “subtitle”.

This will be more customized, since sometimes other fields are used coherently in the whole product and when using your module in the system, changes that are not standardized will be made. For example, we everywhere use a label instead of a title.

Of course, I can make a copy myself and fill it with npm, but I do not think this is necessary since there is already a ready-made module that is being developed and this small innovation will be pleasant for many developers.

Or maybe i can make merge request?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
cmmartincommented, Jan 20, 2018

Use generateNodeProps. For example, to use label as the title and url as the subtitle

<SortableTree
     ...
     generateNodeProps={({ node }) => ({ title: node.label, subtitle: node.url })}
/>

1reaction
fritz-ccommented, Jan 7, 2018

Yeah, I think the current approach provides enough ways for the user to set their title/subtitle parts. If you want to avoid adding an extra property to your nodes just to remove it on export, I would recommend setting the title and subtitle via generateNodeProps, as @borisyordanov suggested.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove hardcoded string value
So any idea how can i remove this hardcoded string value and make it work with lowe and uppercase both? Controller:- Map<String, String>...
Read more >
How to remove Hard-coded URL - Tumult Forums
I was asked to remove the hard-coded URL but I am not sure where to begin. I am using the click tag code...
Read more >
Clean up Hardcoded Pixel Codes - Analyzify Knowledge Base
Learn about the issues with hard-coded pixels and how you can clean them to prevent double-tracking issues with your conversions.
Read more >
How to replace hardcoded string for label text in *.Designer.cs ...
I would like to see label's text in designer and also I don't want to duplicate any code. For buttons replacing of hardcoded...
Read more >
How To Remove Labels & Sticker Residue
Label removal sprays like Goo Gone can work great when it comes to removing stubborn residue. Liberally spray Goo Gone on the label...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found