Why wouldn't you just add primary, danger, outline etc as properties to a single Btn component and handle what renders internally? that way you don't need to know/import loads of components, you just use intuitive props?
It's because of the way JSX compiles into React calls. tag would compile to React.createElement('tag'), which is an html element, whereas Tag will compile to React.createElement(Tag), which is the component. If you weren't using JSX it wouldn't matter, but JSX interprets capital and lowercase letters differently.
Has anybody designed an app where you can actually change the css framework and only change a few base files the way he's talking about? I find my apps littered with bootstrap styles; cards, cols, grids, etc.
Damn, I've never thought that by simply passing all props to the button like {...props} you will also pass children!
Yeah, that surprised me too. Is the reason this works that the built in component supports props.children?
Yep, children are also fields off of props by default in React. Really cool stuff.
Yea I was surprised by that too, then I thought about it for a sec. It's awesome.
A trick: watch movies at flixzone. Been using them for watching all kinds of movies these days.
@Mayson Torin Yup, been using flixzone} for months myself =)
Nice stuff.
I never really found the need to use classnames, js template strings are awesome.
Awesome!
Why wouldn't you just add primary, danger, outline etc as properties to a single Btn component and handle what renders internally? that way you don't need to know/import loads of components, you just use intuitive props?
I think you're on to something here... could you maybe have a working example on JS Bin (modified from jsbin.com/zifitu/edit?js,output)
Does someone have the JSBin link?
So why does the "Tag" variable need to have a capital T?
It's because of the way JSX compiles into React calls. tag would compile to React.createElement('tag'), which is an html element, whereas Tag will compile to React.createElement(Tag), which is the component. If you weren't using JSX it wouldn't matter, but JSX interprets capital and lowercase letters differently.
Has anybody designed an app where you can actually change the css framework and only change a few base files the way he's talking about? I find my apps littered with bootstrap styles; cards, cols, grids, etc.
gay!!!