forked from aksonov/react-native-router-flux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## Example App | ||
|
||
Normally, after a code change to react-native-router-flux src files, | ||
you must remove the node_modules/react-native-router-flux directory | ||
and npm install. The react-native packager wont follow symlinks. | ||
|
||
To assist development, this command watches and rsyncs changes: | ||
|
||
``` | ||
npm run sync-rnrf | ||
``` | ||
|
||
Leave a terminal open running this command when running the Example | ||
app and making react-native-router-flux src changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ea0a260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another solution was to rewrite all
imports
of RNRF in the Example to relativeimports
targeting thesrc
folder.ea0a260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kerumen good catch!
ea0a260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kerumen I can't make it work. import '../index' from Example instead of import 'react-native-router-flux' just doesn't work, seems packager doesn't see outer folders
ea0a260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okey forgot the packager. It works for React projects.
I found this issue debating about symlinks (that can be a solution). There is also a
--root
flag on the packager. You can try to specify it to the root of the project, it should work then.ea0a260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But packager is being run automatically from Xcode run and i don't want to hack RN scripts, i just want to have workable solution out-of-box.
ea0a260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can start the packager from your terminal with
react-native start [--root ..]
. Then launch the build from Xcode. It will recognize the packager instance and use it.ea0a260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but you probably can't imagine how many issues we will get from users when they will not be able to run Example out-of-box :)
ea0a260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, @joenoon's solution is better out-of-the-box then.
ea0a260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also like that this is fairly portable. I've already referenced this command to get rnrf and other modules I'm working on locally into my own app which makes development so much easier. Its simply copy/paste the command, then change the paths, with no need to modify any source files.
ea0a260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why i see red border for Example project now?
ea0a260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aksonov yes, the red border is to visualize the edges of the view. I guess it doesn't need to be on Launch, but its very useful to demo the nav/tab hiding: Go to TabBar page > push new scene > try all the combos and notice the border of the view is correct. Previously it wasn't accounted for. The example app seemed fine before, but only because the content fit in the center of the page and didn't expose the problem.