Skip to content
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

[NO MERGE]Try to fix the react-native view initialized twice #1338

Closed
wants to merge 1 commit into from

Conversation

qingfeng
Copy link
Contributor

Related issues: TheWidlarzGroup/react-native-video#29

RT:
I added a log:

- (UIView *)view
{
  NSLog(@"RCTVideo init RCTVideo init");
  return [[RCTVideo alloc] initWithEventDispatcher:self.bridge.eventDispatcher];
}

result:

2015-05-06 02:50:18.218 gouhuo-native[67470:4294635] RCTVideo init RCTVideo init
2015-05-06 02:50:18.218 gouhuo-native[67470:4294635] RCTVideo init RCTVideo init

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@ide
Copy link
Contributor

ide commented May 19, 2015

This is intentional due to how React Native works. Every view class creates one extra view instance to provide default values for React's diffing algorithm.

If this is causing issues for you, it's likely because your view class is creating some resource that it should be lazily initializing instead. So try deferring the initialization of those resources as late as possible, for example when properties are set.

@ide ide closed this May 19, 2015
@qingfeng qingfeng deleted the fix_manager_view branch May 19, 2015 09:42
ayushjainrksh pushed a commit to MLH-Fellowship/react-native that referenced this pull request Jul 2, 2020
* Initial commit

* Issue facebook#1338 V0.28 Corrects insensitive or inconsiderate language in version-28 of React Native Docs

* Resolving merge conflict in alexignore file

* facebook#1338 Removes version-28 from alexignore

* Delete yarn.lock
ayushjainrksh pushed a commit to MLH-Fellowship/react-native that referenced this pull request Jul 2, 2020
* Initial commit

* Issue facebook#1338 Removes version29 from alexignore

* Issue facebook#1338 V0.29 Corrects insensitive or inconsiderate language in version-29 of react native documentation

* Delete yarn.lock
mischreiber pushed a commit to ryanlntn/react-native that referenced this pull request Aug 22, 2022
This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)

Co-authored-by: Scott Kyle <skyle@fb.com>
mganandraj pushed a commit to mganandraj/react-native that referenced this pull request Aug 28, 2022
…acebook#1374)

* Refactor handling of keyDown/keyUp (facebook#1338)

This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)

Co-authored-by: Scott Kyle <skyle@fb.com>

* Deprecate onScrollKeyDown, refactor Flatlist selection logic (facebook#1365)

* Deprecate onScrollKeyDown

remove pressable diff

Remove JS handling for PageUp/Down, fix flow errors

Add back "autoscroll to focused view" behavior

remove commented code

remove change to pressable

Update documentation

fix flow error

fix lint issue

Fix 'selectRowAtIndex'

More simplification

lock

* Make method public again

* Add initialSelectedIndex

* macOS tags

* fix lint

* RNTester: only show the Flatlist keyboard navigation switch on macOS

Co-authored-by: Christoph Purrer <christophpurrer@outlook.com>
Co-authored-by: Scott Kyle <skyle@fb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants