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

Consider implementing RCTModalHostView #618

Closed
andrewwebber opened this issue Aug 23, 2016 · 11 comments
Closed

Consider implementing RCTModalHostView #618

andrewwebber opened this issue Aug 23, 2016 · 11 comments

Comments

@andrewwebber
Copy link

https://facebook.github.io/react-native/docs/modal.html

@quincycs
Copy link
Contributor

quincycs commented Oct 16, 2016

is there a list of components implemented vs not implemented? maybe someplace inside the code to refer to (since documentation can be out of date).

when writing an RN app, it would be nice to know that i'm coding against a component that isn't supported for windows. like a grid listing components with checkmark for support.

@adisoftbn
Copy link

The list is here: https://github.com/ReactWindows/react-native-windows/blob/master/docs/CoreParityStatus.md

I also need the modal component and I will try to temporary simulate it with absolute positioning view somehow. I dont know if it will work.

@asteingass
Copy link

Hello, any updates on this? Has someone found a good workaround?
Thanks
Andreas

@kevinvangelder
Copy link
Contributor

It is possible to do a pure JS implementation, which is what we're doing for now.

import React, { Component } from 'react'
import { View } from 'react-native'
import Styles from './Styles/ModalStyles'

export default class Modal extends Component {
  static propTypes = {
    visible: React.PropTypes.bool,
    children: React.PropTypes.object
  }

  render () {
    if (!this.props.visible) return (<View />)

    return (
      <View style={Styles.modal}>
        {this.props.children}
      </View>
    )
  }
}

@asteingass
Copy link

@kevinvangelder Thanks for the answere. So you just define then a "smaller" screen in the style, right?

@kevinvangelder
Copy link
Contributor

Correct, and it has the added benefit that you get full control of the backdrop (the RN modal only lets you control transparency via Boolean). Just be sure to render it last thing or use a z-index.

@asteingass
Copy link

Do you have an example style? That would be awesome.
Thanks in advance

@kevinvangelder
Copy link
Contributor

import { StyleSheet } from 'react-native'

export default StyleSheet.create({
  modal: {
    position: 'absolute',
    top: 0,
    right: 0,
    bottom: 0,
    left: 0,
    backgroundColor: 'rgba(0,0,0,0.5)',
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center'
  }
})

@fatfatson
Copy link

need this

@acuntex
Copy link

acuntex commented Jul 3, 2018

It's pretty hard to use react-native-windows without RCTModalHostView because a lot of 3rd party components use Modal to position elements.

@rozele
Copy link
Collaborator

rozele commented Feb 26, 2019

Closed by #1996

@rozele rozele closed this as completed Feb 26, 2019
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

No branches or pull requests

8 participants