-
Notifications
You must be signed in to change notification settings - Fork 10
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
How to render literals inside an expession? #8
Comments
Ok, I'll see if I can add that feature to this. |
@cah4a We've made a small but important update in react-ast version 0.4.1 <CallExpression
name="fn"
arguments={
<StringLiteral>a</StringLiteral>
}
/> |
That's cool! Thanks! BooleanLiterals, BigIntLiteral, RegExpLiteral might be useful too. |
@cah4a can you explain what you mean by |
I mean something like this: <CallExpression
name="fn"
arguments={
<Literal value={argument}/>
}/> where an argument could be string, number, boolean, bigint, object, symbol, null, or undefined. I have a feeling the library should be able to render any javascript code, not a subset. |
Gotcha, yeah I think we can make that work. We just finished a big refactor to update all the modules to the latest. Should be able to get to this soon. |
There is no
Literal
component, which I expected from that library.Tried to use Smart component:
that gave totally unexpected output for me:
fn('a';);
The text was updated successfully, but these errors were encountered: