Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown: invalid PropType noResultMessage #3175

Closed
lazazivkovic opened this issue Sep 27, 2018 · 4 comments
Closed

Dropdown: invalid PropType noResultMessage #3175

lazazivkovic opened this issue Sep 27, 2018 · 4 comments
Labels

Comments

@lazazivkovic
Copy link
Contributor

Steps

When using the Dropdown component with selection & search enabled, I want to be able to pass a React component as a noResultMessage to allow for links. This works as expected (it displays fine), but results in proptype warning in the console.

NOTE: - Same as #1664, only for other component (Dropdown instead of Search).

Expected Result

No warning in console

Actual Result

Failed prop type: Invalid prop noResultsMessage of type object supplied to Dropdown, expected string.

Version

0.77.1

Testcase

<Dropdown
    search
    selection
    options={[
        { value: 1, text: '1' },
        { value: 2, text: '2' },
        { value: 3, text: '3' },
    ]}
    noResultsMessage={(
        <div>
            <div>No results found</div>
            <Link onClick={addManually}>Add manually</Link>
        </div>
    )}
/>
@yuritoledo
Copy link

@lazazivkovic why you dont use this props?

image

mode details here, you can use custom components too

@lazazivkovic
Copy link
Contributor Author

Hi @yuritoledo

Thanks for the suggestion, but that unfortunately does not solve my problem. I'm not trying to add an option to the existing ones, rather, I would like to add a link which would lead me to another form, where that data could be entered manually. So the noResultsMessage is the actual prop I need, only it doesn't support React components as value at the moment. Actually, it works, but triggers a warning in the console. Thanks for the suggestion anyway. 😃

@lazazivkovic
Copy link
Contributor Author

Hi @layershifter, could you please take a look at #3177? Thanks 😃

@levithomason
Copy link
Member

Fixed in #3177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants