-
Notifications
You must be signed in to change notification settings - Fork 55
allow render_react_component(name, props, class: "...") #9
base: master
Are you sure you want to change the base?
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.
Can you elaborate on why you need this? Specifically, why does any code besides hypernova's clientside JS need to reference this div?
attributes = '' | ||
options = job[:html_options] | ||
if options && options[:class] | ||
attributes << %{ class="#{options[:class]}"} |
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.
what if options[:class]
includes a double quote? please include a test case that covers this.
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.
How about cb90ed4 ?
This is because we need to apply CSS. Out code includes CSS something like this: foo {
*[data-hypernova-key] {
// blah blah blah
}
} This works but I think it is ugly and I don't want to depend on hypernova-specific things in CSS. If this PR is merged, I just add a CSS selector to the hypernova's div. |
@gfx what CSS are you trying to apply that can't be applied to the root element of your react tree? |
Here you are: *[data-hypernova-key] {
height: 100%;
} The |
To clarify, does this mean you're rendering the entire HTML content with react, and you want it to take up the whole screen? |
I have a couple of use-cases:
Put it all together:
I could move the Unfortunately, I cannot render the whole application in React because our codebase is a mixture of accumulated tech stacks. |
We need to specify HTML
class
attributes to the wrapper div elements.Can you review it please?
BTW I can't pass the test (#8) so the CI will fail :(