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.

add support for setting JSX for title on Dialog props

See original GitHub issue

We want to avoid contributors using Dialog and nesting DialogHeader within if they only want the default behaviour. See https://github.com/desktop/desktop/pull/6027#discussion_r229337387 for more discussion.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
niikcommented, Mar 8, 2019

Hey @shiftkey, sorry, I’ve completed missed this.

// TODO: how can we get a string-like representation of a JSX element?
 const id = typeof this.props.title === 'string' ? this.props.title : '???'```

You can ignore this entirely. CreateUniqueId will ensure it’s a unique id regardless of what you pass it so just leave that as-is (ie. pass the raw JSX.Element to it, that’s fine). You can use createUniqueId without giving it anything if you like and it’ll take care of it, we only give it something that’s slightly human readable for sanity’s sake.

1reaction
shiftkeycommented, Oct 30, 2018

It looks like that doesn’t actually render the element so the code might not work as described.

To be clear, I’m only looking for a string-like representation of the element for situations where we need something distinct to work with (the original issue was using the title to generate a unique id). I’m not looking to actually render the elements.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Create Wrapper Components in React with Props
To create wrapper components, you'll first learn to use the rest and spread operators to collect unused props to pass down to nested...
Read more >
Getting started with React Dialog component
Now, you can start adding React Dialog component to the application. We have added Dialog component in src/App.tsx file using following code.
Read more >
How can I set a height to a Dialog in Material-UI?
I've tried setting the maxHeight to none and setting height , but I've had no luck with it. reactjs · material-ui · Share....
Read more >
Accessibility
Setting the document title​​ We can set this in React using the React Document Title Component.
Read more >
React Dialog component - Material UI
Dialogs inform users about a task and can contain critical information, ... icons, clarifying subtext, or orthogonal actions (such as adding an account)....
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