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.

Provide an option to disable props filtering

See original GitHub issue

Describe the enhancement

Provide an option to disable props filtering.

Motivation

Now, there is a filter for props:

https://github.com/callstack/linaria/blob/master/packages/react/src/styled.ts#L111-L120

But the conditions for checking whether an element is HTML tag or custom element are not satisfy with our cases.

We have some element with names like: ViewTextInput from WeChat MiniApp,and both of them have some special attributes like: hoverClass.Once linaria filter these attributes, then it will not work correctly.

WeChat MiniApp’ docs

Possible implementations

// Check if it's an HTML tag and not a custom element
if (options.enablePropsFilter && typeof component === 'string' && component.indexOf('-') === -1) {
  // ...
} else {
  filteredProps = rest;
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Anbercommented, May 29, 2022

Ok, I have an idea, but I need some time to implement it.

0reactions
Anbercommented, May 29, 2022

@Chen-jj Unfortunately, it seems like there is no way to detect whether or not passed argument is a default tag or a custom component. According to the specs, names of custom components must have a hyphen, so View and especially view are just wrong names and we cannot support them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Select disable options - Stack Overflow
use isOptionDisabled props of react-select component to filter options based on 'disabled' property. Here's an example:
Read more >
React interactivity: Editing, filtering, conditional rendering
Add an onClick handler that calls props.setFilter() with the filter's name. With all of that done, your FilterButton() function should read like ...
Read more >
React-admin - Filtering the List
React-admin uses the filter query parameter from the URL to determine the filters to apply to the list. To change the filters, react-admin...
Read more >
Column Filter Props · react-bootstrap-table2
Give filter prop on BootstrapTable which value is the return value from calling filterFactory function; Add filter property on column object:.
Read more >
Data Grid - Filtering - MUI X
Filters are enabled by default, but you can easily disable this feature by setting the disableColumnFilter prop. <DataGrid disableColumnFilter />
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