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.

Using Custom Component (Semantic UI - Dropdown & co )

See original GitHub issue

Hey,

In the first place, thanks for this awesome libs.

Everything works well.

I’m trying to use React-Semantic-UI Component with redux-form. I searched inside the docs how about integrate custom component with redux form, and here we go : http://redux-form.com/6.5.0/docs/faq/CustomComponent.md/ Seems perfect.

But when i integrate Semantic and this, it doenst work.

This is my simple test :

const TestComponent = props => (
<Form>
     <Field name="dropdownTest" component={ TestSelect } />
</Form>
)

and here my CustomComponent using Dropdown. You can found the dropdown documentation & props (onChange & value ) here :

http://react.semantic-ui.com/modules/dropdown

import Form , Dropdown from 'semantic-ui-react'
import {myOption from './myOption'

const TestSelect = field = (
   <Form.Field>
            <label> Test dropdown </label>
             <Dropdown option={myOption} selection 
                                   value={{val : field.input.value}}
                                   onChange={ param => field.input.onChange(param.val)} />
     </Form.Field>
)


As in the documentation, I added value & onChange props on my Custom Component.

I clearly miss something here.

Thanks for helping.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

18reactions
GreGGuscommented, Feb 10, 2017

Ok I succed, you can close this issue.

const TestComponent = props => (
<Form>
     <Field name="dropdownName" component={ DropdownFormField}
            label="Dropdown Test" 
      />

</Form>
)



const DropdownFormField = props => (
 <Form.Field>
   <Dropdown selection {...props.input}
             value={props.input.value}
             onChange={(param,data) => props.input.onChange(data.value)}
             placeholder={props.label} 
    />
  </Form.Field>
)
4reactions
niksmaccommented, Nov 29, 2018

Adding onChange={(param,data) => props.input.onChange(data.value)} will show the value

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Custom Component (Semantic UI - Dropdown & co )
I'm trying to use React-Semantic-UI Component with redux-form. ... Using Custom Component (Semantic UI - Dropdown & co ) #2562.
Read more >
Dropdown - Semantic UI React
A dropdown menu can contain dividers to separate related content. ... Dropdown state is not fully managed when using the subcomponent API. The...
Read more >
How to customize dropdown item in react semantic-ui-react?
1 Answer 1 ; import { Dropdown } ; from "semantic-ui-react" ; const Campaign ; props) => { const ; getCustomerGroupOptions = () ......
Read more >
ReactJS Semantic UI Dropdown Module - GeeksforGeeks
In this article we see know how to use Dropdown Module in ReactJS Semantic UI. The Dropdown Module allows a user to select...
Read more >
semantic-ui-react.Dropdown.Item JavaScript and Node.js ...
Best JavaScript code snippets using semantic-ui-react.Dropdown.Item(Showing top 8 results out of 315) · app/javascript/src/components/layout/menu/userMenu. · app/ ...
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