Skip to content

Missing esx.register of imported component #2

@irudoy

Description

@irudoy

There are no esx.register call when importing component with import statement.

test('JSX component registration – import', async ({ is }) => {
  const src = [
    `import React from 'react'`,
    `import Foo from './foo'`,
    'module.exports = <div><Foo/></div>'
  ].join('\n')
  const esx = [
    `const esx = require('esx')()`,
    `import React from 'react'`,
    `import Foo from './foo'`,
    'esx.register({ Foo })',
    'module.exports = esx `<div><Foo/></div>`'
  ].join('\n')
  is(convert(src), esx)
})
--- wanted                                
+++ found                                 
const esx = require('esx')()             
import React from 'react'                
import Foo from './foo'                  
-esx.register({ Foo })                    
module.exports = esx `<div><Foo/></div>`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions