fullstorydev / fullstory-babel-plugin-annotate-react

A Babel plugin that annotates React components, making them easier to target with FullStory search
MIT License
30 stars 13 forks source link

Mobx observers don't get transformed #61

Closed pnegahdar closed 3 months ago

pnegahdar commented 2 years ago

I raised this issue in the Mobx repo as well here: https://github.com/mobxjs/mobx/issues/3206

Components that are wrapped with their observer() hoc fail to be injected. Would this issue be with mobx or this plugin?

rcmaples commented 2 years ago

Hi @pnegahdar - RC from FullStory's support team here. We're not really set up to provide support via Github issues. If you're running into an issue in a web app, can you reach out to support@fullstory.com with details about any error you're running into? If it's a mobile app you can email mobile-support@fullstory.com and we'll work with you there to figure out what's going on.

Thanks so much!

RyanCommits commented 3 months ago

Our annotate plugin currently does not support anonymous function components.

import { observer } from "mobx-react-lite";

const HelloView = () => {
  return <div>hello</div>;
};

const ObserverView = observer(HelloView); // <-- this will be annotated;
const ObserverViewFAIL = observer(() => <div>hello</div>); // <-- this will not be annotated;

If this does not apply to your situation, please reopen this issue with an example of your use case. Thanks!