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

Updates to react-select creatable example #13

Open
gilesbutler opened this issue Jan 28, 2018 · 0 comments
Open

Updates to react-select creatable example #13

gilesbutler opened this issue Jan 28, 2018 · 0 comments

Comments

@gilesbutler
Copy link

Hey @foxhound87,

Just found your awesome library, great work and thanks!!

I've been trying to implement your react-select creatable example this weekend but it's slightly out of date with current best practices. From what I can see Lodash now advise not to use _.chain anymore based on this article. Based on that I was trying to reimplement your demo code but not sure how to reimplment this...

const $values = _.chain(values)
          .mapValues('value')
          .values()
          .value();

piece of code correctly. So far I've ended up with this...

// Get the entered value
const v = lodashMapValues(values, o => o.value);
const v2 = lodashValues(v);
const $values = v2.filter(x => x !== undefined);

I'm mapping over the values to get the value, then converting it to an array, then finally removing the undefined items. I'm not sure if that is the correct intent of the original though?

Then with the rest of the code, I don't want to have the extra input fields underneath the select field as in the example, would that just be a case of removing these lines...

dynamicFields.$(item).set('placeholder', item);
dynamicFields.$(item).set('bindings', 'MaterialTextField');

Appreciate any help you can offer.

Thanks

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

No branches or pull requests

1 participant