How can web parts know of and interact with each other within the SharePoint Framework?
Here's an example. Let's say we need:
- a search box web part
- search result web part
- a filter web part
All built by us in SPFx. All placed on one page.
The user types a search query into the search box - the search result web part and the filter web part should update while typing. The user clicks a value in the filter web part - the search result web part should update. And so on. Highly interactive.
And this is just one example, you could imagine other complex, modular UIs.
The user is free to place any of these web parts on any page (modern and classic). He could leave the filter web part out and just place the search box and search result web part and it should work. If he omits a critical web part the other web parts should detect this and show a hint.
So the web parts "know" each other and bind their UI to a shared state. User interaction in one web part triggers actions in other web parts.
How would you approach this in the most SPFx-compatible manner? I think I could always use a shared data blob somewhere and somehow bind to that (how?). But is this the way? What are the alternatives?