Skip to content

Commit

Permalink
Merge branch 'CAMP-2273/add-ref-to-input-element'
Browse files Browse the repository at this point in the history
  • Loading branch information
PrashantKIsHere committed Feb 18, 2020
2 parents fc79ea0 + 4e3f7b2 commit 0911828
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions packages/components/lib/Input.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import React from 'react'
import React, { forwardRef } from 'react'
import PropTypes from 'prop-types'
import mods from './internal/mods'

const Input = ({ centered, rounded, separator, className, ...rest }) => (
<input
className={mods('input', { centered, rounded, separator }, className)}
{...rest}
/>
const Input = forwardRef(
({ centered, rounded, separator, className, ...rest }, ref) => (
<input
className={mods('input', { centered, rounded, separator }, className)}
ref={ref}
{...rest}
/>
),
)

Input.displayName = 'Input'
Input.propTypes = {
centered: PropTypes.bool,
rounded: PropTypes.bool,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@campgladiator/components",
"version": "1.0.13",
"version": "1.0.14",
"description": "A component library for CampGladiator's React apps",
"author": "renanpvaz <[email protected]>",
"homepage": "https://github.com/CampGladiator/ui/tree/master/packages/components#readme",
Expand Down

0 comments on commit 0911828

Please sign in to comment.