algolia / algolia/react-element-to-jsx-string

Support for overriding prop values

Open
#530 5 comments 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
518
Forks
87
Avg merge
3h 56m
Merged PRs (30d)
3

Description

Not sure if this functionality is already available, but currently, if you provide another component to an attribute, the JSX that is rendered shows the value of the object instead of the displayName. For example:
``
is rendered like:
``

I would like to only show the displayName in this scenario.
Is there a way to override the string the attribute returns?

If not, maybe we can make a slight adjustment to options.filterProps to work similarly to options.displayName?
If you provide a function, and that function returns a string that isn't a boolean, use that new string for the attribute value instead.

Sound good?

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no files or tests; start by locating the handling for options.filterProps and compare it with options.displayName. Check whether the proposed override can produce a non-boolean string, then verify that a component such as Card.Header renders by displayName rather than its object value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.