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.

Change type signature of the SimpleLink component

See original GitHub issue

Change type signature from:

const BaseSimpleLink = styled<"a" | "button">("button", {
  shouldForwardProp: prop => !["color_", "left_", "right_"].includes(prop),
 })

To:

const BaseSimpleLink = (styled<"a" | "button">).button``

The .button syntax automatically filters props and make code much cleaner.

Issue Analytics

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

github_iconTop GitHub Comments

7reactions
stereoboostercommented, Jul 16, 2019

Let me help you here a bit. What I would do first is find the type definition. For example in IDE (in my case vscode) <kbd>cmd</kbd> + click on styled

Screenshot 2019-07-15 at 22 39 16
export default styled as CreateStyled<OperationalStyleConstants>

<kbd>cmd</kbd> + click on CreateStyled

export interface CreateStyled<Theme extends object = any>
  extends BaseCreateStyled<Theme>,
    StyledTags<Theme> {}

<kbd>cmd</kbd> + click on CreateStyled

export interface CreateStyled<Theme extends object = any> {
  <Tag extends React.ComponentType<any>, ExtraProps = {}>(
    tag: Tag,
    options?: StyledOptions
  ): CreateStyledComponentExtrinsic<Tag, ExtraProps, Theme>

  <Tag extends keyof JSXInEl, ExtraProps = {}>(
    tag: Tag,
    options?: StyledOptions
  ): CreateStyledComponentIntrinsic<Tag, ExtraProps, Theme>
}

as you can see param type here is Tag (<Tag, ExtraProps>()).

Let’s see definition of styled.button:

export interface StyledTags<Theme extends object> {
  // ...
  button: CreateStyledComponentIntrinsic<'button', {}, Theme>

as you can see button comes with predefined “tag” type, so you can’t change it like this (styled<"a" | "button">).button.

1reaction
TejasQcommented, Jul 17, 2019

Great! So shall we close this issue then?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simplelink Sign Counter Changed flag - Bluetooth forum - TI E2E
Simplelink Sign Counter Changed flag ... Does the device signature change frequently? ... The sign counter is used as part of the CSRK....
Read more >
Change Signature - Documentation for Visual Assist
You can use Change Signature to modify all parts of a signature, including: Method name; Return type; Visibility; Parameter names; Parameter types; Parameter ......
Read more >
Sign an e-signature Request - FileInvite Help
How to use our e-signature feature to sign off documentation that has been ... Method 2: Type your name and have a signature...
Read more >
Sasukepedia:Signatures | Sasukepedia Wiki | Fandom
A signature is, by default, a simple link to the user page of the ... In the "Signature" edit box, add {{the template...
Read more >
TV - Simplink Function - LG
TV - Simplink Function · Immediate playback · Controlling devices with the TV remote control · Automatic switch-off · Auto Power On ·...
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