Skip to content

[Bug]: Missing type exports #4139

Description

@marius-at-atb

Mapbox Implementation

Mapbox

Mapbox Version

11.15.0

React Native Version

0.83.1

React Native Architecture

New Architecture (Fabric/TurboModules)

Platform

iOS

@rnmapbox/maps version

10.2.10

Standalone component to reproduce

import {Expression} from '@rnmapbox/maps/src/utils/MapboxStyles';
const myExpression: Expression = ['get', 'myProp']

Observed behavior and steps to reproduce

On the new version, this has to be imported with
node_modules/ as a prefix -> import {Expression} from 'node_modules/@rnmapbox/maps/src/utils/MapboxStyles'

Expected behavior

Import without node_modules/ prefix.

Notes / preliminary analysis

Same thing needed for type imports from these paths:
node_modules/@rnmapbox/maps/src/components/SymbolLayer
node_modules/@rnmapbox/maps/src/utils/MapboxStyles
node_modules/@rnmapbox/maps/src/components/MapView
node_modules/@rnmapbox/maps/src/types/OnPressEvent

Unless I'm doing something wrong?

Additional links and references

No response

Activity

  1. FernandoAOborges commented on Feb 11, 2026

    @FernandoAOborges

    The solution I’m using to get the types is:

    export type MapboxExpression = React.ComponentProps<
      typeof CircleLayer
    >['filter']
    
    export type MapboxCircleStyle = React.ComponentProps<
      typeof CircleLayer
    >['style']
    
    export type MapboxSymbolStyle = React.ComponentProps<
      typeof SymbolLayer
    >['style']
    
  2. allthetime commented on May 20, 2026

    @allthetime

    They need to be added here:

    https://github.com/rnmapbox/maps/blob/main/src/Mapbox.native.ts

    Lots of types exported from library files are missing.

  3. mfazekas commented on Oct 13, 2026

    @mfazekas
    Contributor

    The src/ paths aren't part of the public API, so we don't plan to re-expose them. We also don't want to export a single Expression type: expressions for different props (filters, colors, numbers, …) may not share the same type in the future. Please derive the type from the component prop instead, e.g.

    type CircleFilter = React.ComponentProps<typeof CircleLayer>[filter];
    type CircleColor = CircleLayerStyle[circleColor];

    That stays correct if we make the expression types stricter per prop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions