-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: docusaurus v2 #669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: docusaurus v2 #669
Conversation
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 a lot!
Seems like the stuff inside .docusaurus
folder shouldn't be committed to git but they are present in the commit
@satya164 yeah, you're right. Just removed this one. |
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.
There seem to be 2 folders, website/
and website1
. Why are both folders needed?
Also I would like to remove docs from website/docs
and keep everything in versioned like in current repo because having duplicated docs in docs/
always confuses users.
thanks! I'll remove the
if we remove the |
yea, we don't have a next right now |
done :) |
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.
Good job! I will test it tomorrow to see if the links etc. work correctly.
|
||
Returning `true` from `onBackButtonPressAndroid` denotes that we have handled the event, and react-navigation's listener will not get called, thus not popping the screen. Returning `false` will cause the event to bubble up and react-navigation's listener will pop the screen. | ||
|
||
``` |
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.
Shouldn't it be there?
``` | |
```js |
|
||
### `getStateForAction(action, state)` | ||
|
||
Defines the navigation state in response to a given action. This function will be run when an action gets passed into `props.navigation.dispatch(`, or when any of the helper functions are called, like `navigation.navigate(`. |
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.
Defines the navigation state in response to a given action. This function will be run when an action gets passed into `props.navigation.dispatch(`, or when any of the helper functions are called, like `navigation.navigate(`. | |
Defines the navigation state in response to a given action. This function will be run when an action gets passed into `props.navigation.dispatch()`, or when any of the helper functions are called, like `navigation.navigate()`. |
|
||
Typically this should return a navigation state, with the following form: | ||
|
||
``` |
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.
``` | |
```js |
|
||
### Example | ||
|
||
```jsx harmony |
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.
```jsx harmony | |
```js |
const MyScreen = () => ( | ||
<View> | ||
<NavigationEvents | ||
onWillFocus={payload => console.log('will focus',payload)} |
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.
onWillFocus={payload => console.log('will focus',payload)} | |
onWillFocus={payload => console.log('will focus', payload)} |
same below
@@ -71,9 +70,9 @@ Position of the tab bar in the tab view. Possible values are `'top'` and `'botto | |||
|
|||
#### `lazy` | |||
|
|||
Boolean indicating whether to lazily render the scenes. When this is set to `true`, screens will be rendered as they come into the viewport. By default all scenes are rendered to provide a smoother swipe experience. But you might want to defer the rendering of screens out of the viewport until the user sees them. To enable lazy rendering, set `lazy` to `true`. |
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.
Maybe updating the docs in this way should be in another PR to keep some kind of single responsibility PRs? Wdyt @satya164?
@@ -39,7 +38,7 @@ In the above example, the `Home` component contains a tab navigator. The `Home` | |||
- `Profile` (`Screen`) | |||
- `Settings` (`Screen`) | |||
|
|||
Nesting navigators work very much like nesting regular components. To achieve the behavior you want, it's often necessary to nest multiple navigators. | |||
To achieve the behavior you want, it's often necessary to nest multiple navigators. For example, if you want. |
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.
Is it ended?
@@ -59,10 +58,6 @@ For example, if you have a stack inside a drawer navigator, the drawer's `openDr | |||
|
|||
Similarly, if you have a tab navigator inside stack navigator, the screens in the tab navigator will get the `push` and `replace` methods for stack in their `navigation` prop. | |||
|
|||
### Nested navigators don't receive parent's events | |||
|
|||
For example, if you have a stack navigator nested inside a tab navigator, the screens in the stack navigator won't receive the events emitted by the parent tab navigator such as (`tabPress`) when using `navigation.addListener`. To receive events from parent navigator, you can explicitly listen to parent's events with `navigation.dangerouslyGetParent().addListener`. |
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.
Why delete this?
@@ -126,21 +123,6 @@ headerStyle: { | |||
|
|||
To set a custom header for all the screens in the navigator, you can specify this option in the `screenOptions` prop of the navigator. | |||
|
|||
If you want your custom header to animate with screen transitions and want to keep `headerMode` as `float`, you can interpolate on the `scene.progress.current` and `scene.progress.next` props. For example, following will cross-fade the header: |
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.
Why delete this too?
@@ -43,7 +41,7 @@ export default function App() { | |||
} | |||
|
|||
return ( | |||
<NavigationContainer initialState={initialState} ref={ref}> | |||
<NavigationContainer initialState={initialState}> |
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.
Why remove ref? It is used in useLinking
.
I think these deletions/changes are because of bad merge. Let's make a pass to see the documentation is the same as master and then merge :) |
yeah, @satya164 is right, @WoLewicki. Basically, some things were needed to change when migrating v1 to v2. -- id: VERSION-FILE_NAME
-- original_id: FILE_NAME the original_id was removed and the and |
I've fixed the merge related issues. I was running it locally, few things:
|
thanks ❤️
yes
for sure, I'll change
yeah, we can move everything to root now.
yeah Thanks for all feedback @satya164. |
|
…act-navigation/react-navigation.github.io into @eriveltonelias/docusaurus-v2
@satya164
|
Just fixed videos not playing because docusaurus now uses MDX and it needs to be |
Turns out the blog doesn't load because the chunk name has "ad" in it which gets blocked by uBlock origin 🤦♂ |
It's live https://reactnavigation.org/ Thanks so much for working on this :D |
Seems the new version breaks all the links because of removing But I didn't notice that translations don't work 😱 Until we figure that out, I've reverted to v1 and put the v2 branch here https://github.com/react-navigation/react-navigation.github.io/commits/docusaurus-v2 |
❤️😭 |
😩haha sure, let me work on that, btw our account on Crowdin was suspended, do you have an idea why? |
Sorry for this long PR 😅, but a lot of changes were necessary to migrate Docusaurus v1 to v2.
on this link https://v2.docusaurus.io/docs/migrating-from-v1-to-v2 we can see the instructions to migrate, may it help for review.