Skip to content
Discussion options

You must be logged in to vote

try

pub struct AttributeUpdater<'a> {
    pub allocator: &'a Allocator,
    pub ast_builder: AstBuilder<'a>,
}

impl<'a> VisitMut<'a> for AttributeUpdater<'a> {
    fn visit_jsx_attribute(&mut self, it: &mut oxc_ast::ast::JSXAttribute<'a>) {
        if let JSXAttributeName::Identifier(ident) = &it.name {
            if ident.name == "className" {
                let value = it.value.as_ref().unwrap();

                if let JSXAttributeValue::StringLiteral(string_value) = value {
                    let uppercased = string_value.value.to_uppercase();
                    let atom = self.allocator.alloc_str(&uppercased);

                    // Create new StringLiteral with proper JSX attr…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@akzhy
Comment options

@camc314
Comment options

camc314 Jun 26, 2025
Collaborator

@akzhy
Comment options

Answer selected by akzhy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants