Using material-components with React and passing values into tags #5544
Replies: 2 comments
-
You can pass in function IconButton(props) {
return <md-icon-button>{props.children}</md-icon-button>;
}
function Usage() {
return <IconButton><md-icon>check</md-icon></IconButton>;
} |
Beta Was this translation helpful? Give feedback.
-
I tried to create a React library using this library along with lit/react. You can refer to my GitHub project for an example of how to work with React. |
Beta Was this translation helpful? Give feedback.
-
In a previous discussion, the question was about bringing material-web components in React, and the answer was to put them in a wrapper, and import that function. What if you wanted to create an icon button, something like this:
<md-icon-button> <md-icon>check</md-icon> </md-icon-button>
How would I pass in an tag, with a check type of icon, or whatever other icon?
Beta Was this translation helpful? Give feedback.
All reactions