Skip to content

Conversation

@piaskowyk
Copy link
Member

@piaskowyk piaskowyk commented Apr 10, 2025

Summary

This PR introduces a common implementation of custom shadow nodes for both Android and iOS. It's part of the migration towards using display: content.

Screenshot 2025-04-11 at 13 42 07

Screenshot 2025-04-11 at 13 42 26

Test plan

Example code
import React, { useState } from 'react';
import { Button, StyleSheet, Text, View } from 'react-native';
import { ReanimatedView } from 'react-native-reanimated';

export default function EmptyExample() {
  const [color, setColor] = useState('red');
  return (
    <View style={styles.container}>
      <Text>Hello world!</Text>
      <ReanimatedView style={{width: 200, backgroundColor: 'green' }}>
        <Text>Reanimated View</Text>
        <View style={{width: 100, height: 100, backgroundColor: color }} />
        <View style={{width: 100, height: 100, backgroundColor: 'blue' }} />
        <View style={{width: 100, height: 100, backgroundColor: 'yellow' }} />
      </ReanimatedView>
      <Button title='Click' onPress={() => {
        setColor(color === 'red' ? 'olive' : 'red');
      }} />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
});

@piaskowyk piaskowyk requested review from MatiPl01 and tomekzaw April 11, 2025 12:45
@piaskowyk piaskowyk marked this pull request as ready for review April 11, 2025 12:45
Copy link
Member

@MatiPl01 MatiPl01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very well. I left just a few comments.

@tomekzaw
Copy link
Member

I'd like to review this PR once the above comments are addressed.

Copy link
Member

@MatiPl01 MatiPl01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please address @tomekzaw comments and should be good to go. 🚀

@piaskowyk piaskowyk added this pull request to the merge queue Apr 14, 2025
Merged via the queue into main with commit 1665895 Apr 14, 2025
13 checks passed
@piaskowyk piaskowyk deleted the @piaskowyk/custom-shadow-node branch April 14, 2025 12:23
@piaskowyk piaskowyk mentioned this pull request Jul 25, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 25, 2025
## Summary
We currently don't use the Native View because we're still experimenting
with replacing commit hooks, etc. With @MatiPl01, we've decided to
remove those changes from the main branch for now because they are
causing some issues. We'll move them later to a branch with the
experimental implementation of `display: content`.
Related PRs:
- #7366
- #7380
## Test plan
See at CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants