You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2025. It is now read-only.
@lynnjepsen, I know I've been blowing you up on discord a bit, but I had to share this.
This is currently hacked together, but the fact that it works is crazy. I found a way to import the actual component class from MDC web and directly use it in React.
I import the class
Pass it to an HOC
I create a new React Component
I copy the MWC component class descriptors over to the new class
I handle the DOM refs in a way that reflects the way the MDC component expects them
The only things I need to specify at this point are things that work a bit different in react like setting classes and a syncWithProps function which can handle the react render cycle.
It is currently hacky as hell, but I thought about this an hour ago and I'm still in shock it actually works.
Check it out
Don't mind all the code in the commit just look at base/MDCFoundation and IconToggle/index.
What does this mean?
I don't have to reimplement a single foundation adapter! I can use all of the ones already written in MWC web with minimal tweaks. I need to work through this more to find the edge cases and do a real implementation, but I'm pretty stoked right now.
tstirrat, schliflo, mrchief, nickserv and adhesivewombat