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.

Rendering with id and default value

See original GitHub issue

In my staging environment I want to wrap my translations with a span, so the translator can hover the text to see which translation key needs to be used. I’ve checked the defaultRender and render methods and this could do the trick, but I need access to the message id and the default message, this is not passed through.

My suggestion would be to pass it through when a Component is used in the render methods, ie: ({id,default,translation}) => translation Any thoughts?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
tricoder42commented, Sep 23, 2018

I had exactly the same usecase in my mind yesterday when I was refactoring Trans component. This could work as an in-context editor. You would have a expandable sidebar with a list of all messages on the page. Then we just need a local server which will communicate with sidebar and we can even edit/save messages from the website 👌

0reactions
tricoder42commented, May 19, 2019

I’m closing it in favor of next branch and upcoming v3 release. Feel free to send a PR if you want to backport it to v2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React render input with default value in separate function to ...
Create a function/component with input tag and pass the props that you want in your input fields like type, placeholder, name, id etc.....
Read more >
A complete guide to React default props - LogRocket Blog
Cover three ways to implement default props in React and provide default values for props that are not required by the component.
Read more >
I can't render default values on form element in theme_table()
Show activity on this post. I create the elements dynamicaly in ajax and i have common problem. The #default_value if not acting in...
Read more >
Layouts and Rendering in Rails - Ruby on Rails Guides
You can render the default view for a Rails template, or a specific template, or a file, or inline code, or nothing at...
Read more >
How to set default value in select using ReactJS
You can use an attribute defaultValue to set the default value in the Select menu If none option is integrated with this attribute...
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