Set global default props
See original GitHub issueIs there a way to use tippy.setDefaultProps or otherwise set default props for all Tippy components?
Using tippy.setDefaultProps doesn’t seem to influence react components.
One option could be creating a proxy component, but that breaks props autocompletion for VSCode.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Default /global props for Text, TextInput, etc #462 - GitHub
Current behaviour Component-specific props can't be set in the theme. Only a few styles such as font family, color etc may be globally...
Read more >React: Everything about Default Props | by Chidume Nnamdi
In this post, we'll learn all about default props in React. ... All these combined together create a UI widget.
Read more >Initializing Text.defaultProps with Typescript - Stack Overflow
I just started rewriting my existing react-native project from js to typescript. To disable font scaling, I set ...
Read more >React set Default Props - DataDrivenInvestor
Because creating React components can be done in many ways. I will show how to set default props in functional components and class-based...
Read more >How to set default props in React - Educative.io
To set a default value for the color prop, use the defaultProps property of CustomButton to set the default value of color to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Repro: https://codesandbox.io/s/pensive-bhabha-s7n4s
Make sure you’re importing
Tippyfrom a central local module/file and only callingsetDefaultPropsonce in that module, that might be the issue.I should’ve done this from the start, but here’s what I want to do: https://codesandbox.io/s/heuristic-herschel-71kwh. As you can see, I’ve tried using tippy without react and the output is the same. Maybe this issue should be moved to tippyjs.
From what I get by reading the source code of tippy, this should be a supported use case.