Closed
Description
Trying the babel plugin with the classnames package im getting errors:
the Button Component is so easy:
import React, { PropTypes } from 'react';
import classNames from 'classnames';
import './button.scss';
const Button = ({ className, href, type, alt, children, onClick }) => {
var btnClass = classNames('button', className, {
'default': type === 'default',
'alt': type === 'alt'
});
return (
<button
styleName={btnClass}
onClick={onClick}
>
{children}
</button>
);
};
export default Button;
Without the classname package its working fine:
import React, { PropTypes } from 'react';
import './button.scss';
const Button = ({ className, href, type, alt, children, onClick }) => {
return (
<button
styleName="button default"
onClick={onClick}
>
{children}
</button>
);
};
export default Button;
Metadata
Metadata
Assignees
Labels
No labels