Skip to content

export all the interal components #3

Description

@diego-toro

Is there a way to access the internal components to follow the react-select approach for customizing components? something like:

import React, { Fragment, useState } from 'react'
import Select, {
  Control as SelectControl, // <-- side exports for destructuring maybe?
} from '@appgeist/react-select-material-ui'

const KINGDOMS = [
  { value: 'AS', label: 'Astur' },
  { value: 'FA', label: 'Fargos' },
  { value: 'LE', label: 'Laeden' },
  { value: 'TH', label: 'Therras' },
  { value: 'VE', label: 'Vessar' },
]

export default () => {
  const [kingdom, setKingdom] = useState(null)

  return (
    <Fragment>
      <h1>Fictional places:</h1>
      <Select
        id="place"
        label="Kingdom"
        placeholder="Select a kingdom"
        options={KINGDOMS}
        value={kingdom}
        onChange={setKingdom}
        isClearable
        helperText="Where would you like to live?"
        size="small"
        components={{
          Control: (props: any[]) => <SelectControl {...props} size="small" />,
        }}
      />
    </Fragment>
  )
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions