Skip to content

Unable to see components in the trace #4

@demon-sword

Description

@demon-sword

I have created some components in the react native sample app. But I am not being able to find them in profiler.
reproducer -> https://github.com/demon-sword/sampleAppProfiling

This is the App component

startProfiling()
function App(): React.JSX.Element {
  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
  };

  return (
    <SafeAreaView style={backgroundStyle}>
      <Component1 />
      <Button title={'StopProfiling'} onPress={() => {
        stopProfiling(true)
      }}/>
    </SafeAreaView>
  );
}
This is the profile that is generated by the produced by the package 

sampling-profiler-trace-1.cpuprofile.txt

Screenshot 2024-05-31 at 3 07 05 PM As you can see in the image that there is only App component is available in the trace. Nothing About Component1 in the trace and there are some empty blocks in the trace as well.

The things I have tried -:

  1. Class components
  2. Functional Components
  3. Exporting components by default
  4. Adding displayNames to components
  5. Tried with Arrow function components as well

Can you please help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions