{"id":4450,"url":"https://github.com/sibs-projects/codemod-RN24-to-RN25","last_synced_at":"2025-07-31T13:31:02.137Z","repository":{"id":71333762,"uuid":"58074901","full_name":"sibs-projects/codemod-RN24-to-RN25","owner":"sibs-projects","description":"A simple codemod to handle the new import style on RN25","archived":true,"fork":false,"pushed_at":"2017-05-04T00:19:15.000Z","size":20,"stargazers_count":103,"open_issues_count":1,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-27T07:25:19.246Z","etag":null,"topics":["codemod","react","react-native"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sibs-projects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-05-04T18:29:55.000Z","updated_at":"2023-01-28T17:59:00.000Z","dependencies_parsed_at":"2023-07-04T20:45:11.937Z","dependency_job_id":null,"html_url":"https://github.com/sibs-projects/codemod-RN24-to-RN25","commit_stats":null,"previous_names":["sibeliusseraphini/codemod-rn24-to-rn25"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sibs-projects%2Fcodemod-RN24-to-RN25","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sibs-projects%2Fcodemod-RN24-to-RN25/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sibs-projects%2Fcodemod-RN24-to-RN25/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sibs-projects%2Fcodemod-RN24-to-RN25/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sibs-projects","download_url":"https://codeload.github.com/sibs-projects/codemod-RN24-to-RN25/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228248582,"owners_count":17891447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codemod","react","react-native"],"created_at":"2024-01-05T20:17:12.978Z","updated_at":"2024-12-05T06:31:42.077Z","avatar_url":"https://github.com/sibs-projects.png","language":"JavaScript","funding_links":[],"categories":["Components"],"sub_categories":["Utils \u0026 Infra"],"readme":"# README\n\nWhy this transform is necessary?\n\nUntil React Native 24, you import React from 'react-native' package, but [this will change in RN 25][1], you will need to import React from 'react', and also all the other React exports like Component, PropTypes, Children and so on.\nYou probably have many files that does this, so I've created a codemod to save you a bunch of time\n\n# How to use this\n\n1. Install jscodeshift\n1. Download this transform\n1. Navigate to the directory\n1. Run the transform\n\n```bash\n# 1\nnpm install -g jscodeshift\n\n# 2, 3\ngit clone https://github.com/sibeliusseraphini/codemod-RN24-to-RN25.git \u0026\u0026 cd codemod-RN24-to-RN25\n\n# 4.\njscodeshift PATH_TO_FILES\n```\n\n# Example\n```js\nimport React, {\n  Component,\n  View,\n  Text,\n  StyleSheet,\n  TouchableHighlight,\n  TextInput,\n  PropTypes,\n} from 'react-native';\nimport NavigationBar from 'react-native-navbar';\n\n\nclass LoginScreen extends Component {\n  render() {\n    return (\n      \u003cView\u003e\n        \u003cNavigationBar\n          tintColor=\"#ADF8D1\"\n        /\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n```\n\nWill be transformed to:\n```js\nimport React, {Component, PropTypes} from \"react\";\nimport {View, Text, StyleSheet, TouchableHighlight, TextInput} from \"react-native\";\nimport NavigationBar from 'react-native-navbar';\n\nclass LoginScreen extends Component {\n  render() {\n    return (\n      \u003cView\u003e\n        \u003cNavigationBar\n          tintColor=\"#ADF8D1\"\n        /\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n```\n\n### Recast Options\n\nOptions to [recast](https://github.com/benjamn/recast)'s printer can be provided\nthrough the `printOptions` command line argument. See the full list of options [here](https://github.com/benjamn/recast/blob/master/lib/options.js).\n\n```sh\njscodeshift PATH_TO_FILES --printOptions='{\"quote\":\"double\"}'\n```\n\n[1]: https://github.com/facebook/react-native/releases/tag/v0.25.1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsibs-projects%2Fcodemod-RN24-to-RN25","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsibs-projects%2Fcodemod-RN24-to-RN25","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsibs-projects%2Fcodemod-RN24-to-RN25/lists"}