Skip to content

Instantly share code, notes, and snippets.

@felippewick
Created November 21, 2023 19:57
Show Gist options
  • Save felippewick/23c444fd409285d0a993221e517bf269 to your computer and use it in GitHub Desktop.
Save felippewick/23c444fd409285d0a993221e517bf269 to your computer and use it in GitHub Desktop.
expo plugin: shared element transition & @react-native-firebase
const plugins = require('expo/config-plugins')
const {
mergeContents,
} = require('@expo/config-plugins/build/utils/generateCode')
const path = require('path')
const fs = require('fs')
module.exports = function withReanimatedUseFrameworks(config) {
return plugins.withDangerousMod(config, [
'ios',
async (config) => {
const filePath = path.join(
config.modRequest.platformProjectRoot,
'Podfile',
)
const contents = fs.readFileSync(filePath, 'utf-8')
const preInstall = mergeContents({
tag: "reanimated_rnfirebase",
src: contents,
newSrc: [
`pre_install do |installer|`,
`installer.pod_targets.each do |pod|`,
`if pod.name.eql?('RNScreens')`,
`def pod.build_type`,
`Pod::BuildType.static_library`,
`end`,
`end`,
`end`,
`end`,
].join('\n'),
offset: 0,
anchor: " flags = get_default_flags()",
comment: '#',
})
fs.writeFileSync(filePath, preInstall.contents)
return config
},
])
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment