Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.cache
.expo
.next
build
coverage
Expand Down
33 changes: 33 additions & 0 deletions apps/animated-example/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"expo": {
"name": "animated-example",
"slug": "animated-example",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"newArchEnabled": true,
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#1a1a2e"
},
"assetBundlePatterns": [
"**/*"
],
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.anonymous.animated-example"
},
"web": {
"bundler": "metro",
"favicon": "./assets/favicon.png"
}
}
}
Binary file added apps/animated-example/assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/animated-example/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/animated-example/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/animated-example/assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions apps/animated-example/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

const reactStrictPreset = require('react-strict-dom/babel-preset');

function getPlatform(caller) {
return caller && caller.platform;
}

function getIsDev(caller) {
if (caller?.isDev != null) return caller.isDev;
// https://babeljs.io/docs/options#envname
return (
process.env.BABEL_ENV === 'development' ||
process.env.NODE_ENV === 'development'
);
}

module.exports = function (api) {
//api.cache(true);

const platform = api.caller(getPlatform);
const dev = api.caller(getIsDev);

const plugins = [];
const presets = [
'babel-preset-expo',
[reactStrictPreset, { debug: true, dev, platform }]
];

return {
plugins,
presets
};
};
16 changes: 16 additions & 0 deletions apps/animated-example/metro.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

// Learn more https://docs.expo.dev/guides/monorepos
const { getDefaultConfig } = require('expo/metro-config');

// Find the project and workspace directories
const projectRoot = __dirname;

const config = getDefaultConfig(projectRoot);

module.exports = config;
30 changes: 30 additions & 0 deletions apps/animated-example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"private": true,
"name": "animated-example",
"version": "0.0.1",
"main": "./src/app/index.js",
"scripts": {
"dev": "expo start --clear",
"dev:android": "expo start --android --clear",
"dev:ios": "expo start --ios --clear",
"dev:web": "expo start --web --clear",
"android": "expo run:android",
"ios": "expo run:ios"
},
"dependencies": {
"@expo/metro-runtime": "~5.0.4",
"expo": "^53.0.11",
"expo-build-properties": "~0.14.6",
"expo-status-bar": "~2.2.3",
"react": "~19.0.0",
"react-dom": "~19.0.0",
"react-native": "~0.79.5",
"react-native-web": "~0.20.0",
"react-strict-dom": "0.0.54",
"react-strict-animated": "0.0.55",
"react-native-safe-area-context": "5.4.0"
},
"devDependencies": {
"@babel/core": "^7.27.3"
}
}
19 changes: 19 additions & 0 deletions apps/animated-example/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

module.exports = {
plugins: [
require('react-strict-dom/postcss-plugin')({
include: [
'src/**/*.{js,jsx,mjs,ts,tsx}',
'../../node_modules/example-ui/**/*.jsx',
'../../node_modules/react-strict-animated/**/*.js'
]
}),
require('autoprefixer')
]
};
24 changes: 24 additions & 0 deletions apps/animated-example/src/app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

// Required for CSS to work on Expo Web.
import './strict.css';
// Required for Fast Refresh to work on Expo Web
import '@expo/metro-runtime';

import { LogBox } from 'react-native';
import { registerRootComponent } from 'expo';
import App from '../components/App';

if (LogBox != null) {
LogBox.ignoreLogs([
// /React Strict DOM: .*/,
// /Failed prop type: .*/,
]);
}

registerRootComponent(App);
29 changes: 29 additions & 0 deletions apps/animated-example/src/app/strict.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

html, body {
height: initial;
}

html {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
overflow: auto;
}

#root {
flex-direction: column;
}

/**
* This directive is used by the react-strict-dom postcss plugin.
* It is automatically replaced with generated CSS during builds.
*/

@react-strict-dom;
Loading